Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do not compile t4 file

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.

like image 616
Code Silverback Avatar asked Dec 28 '22 03:12

Code Silverback


1 Answers

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

like image 85
Matt Mitchell Avatar answered Jan 12 '23 02:01

Matt Mitchell