我将我的解决方案从 VS2008 转换为使用 VS2010 运行。但我仍在运行 .Net 3.5 而不是 4。T4MVC 已停止工作并且无法生成任何代码。如果您能帮忙解决这个问题,那就太好了。
我试图寻找这个问题,但找不到解决方案。我找到了一个转换为 VS2010 .Net4.0 的地方,但这对我没有帮助。
谢谢你的帮助。
我将我的解决方案从 VS2008 转换为使用 VS2010 运行。但我仍在运行 .Net 3.5 而不是 4。T4MVC 已停止工作并且无法生成任何代码。如果您能帮忙解决这个问题,那就太好了。
我试图寻找这个问题,但找不到解决方案。我找到了一个转换为 VS2010 .Net4.0 的地方,但这对我没有帮助。
谢谢你的帮助。
I tried the following, if this helps anyone:
I followed the steps listed here first Cannot get T4MVC to work with VS2010 and ASP.NET MVC 2
As my solution is still running .net 3.5, it complained when I referenced the the TextTemplating DLLs, but I still tried to build the solution for T4MVC to run.
Then I tried changing the language in t4mvc.tt file from <#@ template language="C#v3.5" debug="true" hostspecific="true" #> to <#@ template language="C#" debug="true" hostspecific="true" #> and built the solution
Finally I went back to version 2.6.15, changed the language back to C#v3.5, removed the text templating references and built the solution again.
Don't really know what fixed the issue but its fixed for now. The only manual change that I had to do was in the T4MVC.cs file where instead of a closing bracket, the T4MVC generator put double quotes.
Hope this helps someone.
如果您右键单击 .tt 文件并选择“运行自定义工具”会发生什么?在 t4mvc.tt 的属性下,您应该看到自定义工具设置为“TextTemplatingFileGenerator”。