add custom tool support to shared projects
Both VS 2013 U4 and VS 2015 Preview does not seem to support custom tools in shared projects. That makes it impossible to use shared projects with many useful single file generators, including those shipped with Visual Studio (RESX, T4 Templates, etc.).
In our usecase we would like to use shared projects for shared data models. Normally these data models are specified in our schema DSL and we have MsBuild tasks that generate necessary source code. This approach is not applicable to shared projects because they are never built, however we could do the same with custom tool (single file generator). We tried to create single file generator specifically for shared project type Guid and used Design Data build action and our own generator as custom tool, but it does not have any effect in shared project.
Please, add custom tools support to shared projects. Thanks.
Phill Hallam-Baker commented
Currently, custom tools do not work in anything other than Framework projects. They are broken in .Net Core and they are broken in .Net Standard. I have reported this as a bug but nothing has been done to fix it.
Adding support for shared projects would provide a work-around for the other failures. At the moment, visual studio extensions are essentially not supported for any projects other than Framework.
I'm creating a library which supports dotnetcore and UWP, shared project is a good idea to store the code as almost 100% code are platform neutral. However I can't move my T4 template to the shared project because it's not supported .
I am currently developing a WPF application and an app (Xamarin.Forms) with a shared data model. Because I want to use the Azure Mobile App, the model classes have to implement ITableData on the server side. But this class isn't compatible with the PCL profile 78, so I have to use a shared project. The model classes should be created with a T4 template. That's my current issue.
This comment should be merged with: https://visualstudio.uservoice.com/forums/121579-visual-studio-2015/suggestions/7052744-add-custom-tool-support-to-shared-projects
Lukas Langenegger commented
Geert van Horrik commented
Would love to see this.
George K-K commented
I've posted about this here, initially believing it to be a bug rather than an apparent design decision: https://social.msdn.microsoft.com/Forums/vstudio/en-US/be5b601d-1a80-40f5-8ed8-a2a833f99f40
When building universal applications that require the use of design-time custom tools (such as Razor preprocessors), the inclusion of the "Custom Tool" file property in shared projects would be a tremendous workflow improvement. At the moment, this feature is only available in executables and libraries, which can lead to ugly dependency issues when used in conjunction with shared projects.
See attached images for a comparison of the File Properties panel in a PCL project and the same panel in a shared project.
Carl Brochu commented
Hi Hiroaki, which projects are you trying to use T4 templates with? This would help prioritization. Thanks!
Carl Brochu, VS IDE Team
Hiroaki Shibuki commented
The new shred project is great feature. But, curentry, we can no use T4 template in shared project. I hope it can be.