开发者

VS2010 Disable T4 Template Validation

How do you disable T4 Template validation . VS2010 is validating my T4 Template just now on ever part that has '#' (the sharp character).

error CS1040: Preprocessor directives must appear as the first non-whitespace character on a line

The error is nonsense. I can even generate code from my templates but I can't run my project because my templates throw error CS1040.

I get this error after installing visual t4, even uninstalling from extensions manager won't work. Installing Visual T4 for VS2010 gave me problems with subsonic templates. disabl开发者_C百科ing and uninstalling didn't help either. I am so disappointed.


For some reasons "Build Action" for T4 templates changed to 'compile' just set it back to 'content'


The build action of your T4 template has changed. This may happen when you have copied your files from one project to another, or changed it in the properties by accident.

Steps to resolve it:

  • Right-click the file and choose Properties (Alt+Enter).
  • Select Build Action and change it to the default value None.
  • Save the project and rebuild.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜