Suddenly, after doing a TFS 2010 get, Visual Studio 2010 is attempting to compile my .tt file as if it was c#.
Moreover, anytime I set it to "Build Action=None", Build Action gets mysteriously reset to Compile. This is breaking our builds on the desktop. I can get builds to work on the desktop by closing then reopening VS.
Our builds on TFS are totally broken because of this. What to do?
The template generates a (totally ok) c# file, so I need the project to build.
I tried changing the file extension from .tt to .donotbuilddammit but that had no effect.
Are you by chance using the Clairus T4 plugin (or another T4 intellisense provider)?
If so, try making sure the files are not open when you change the BuildAction setting.
Visual Studio builds intellisense based on the compile action of your files. It will only provide intellisense for files that are marked as "compile". Because of that, we change the build action when the file is open, and we change it back to whatever it was before when checking in, closing the file, closing Visual Studio and also when opening Visual Studio (in case it crashed)
See: http://forums.clariusconsulting.net/viewtopic.php?f=12&t=445
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With