t4mvc 不适用于 VS2010 .Net 3.5
我将我的解决方案从 VS2008 转换为在 VS2010 上运行。但我仍在运行 .Net 3.5 而不是 4。T4MVC 已停止工作并且无法生成任何代码。如果您能帮忙解决这个问题,那就太好了。
我试图寻找这个问题,但找不到解决方案。我发现一个转换为 VS2010 .Net4.0 的地方,但这对我没有帮助。
感谢您的帮助。
I converted my solution to run with VS2010 from VS2008. But I'm still running .Net 3.5 instead of 4. T4MVC has stopped working and is not able to generate any code. Would be great if you could please help with this.
I've tried to look for this issue, but can't find a solution. I found one where the conversion was to VS2010 .Net4.0, but that didn't help me.
Thanks for your help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果右键单击 .tt 文件并选择“运行自定义工具”,会发生什么?在 t4mvc.tt 的属性下,您应该看到自定义工具设置为“TextTemplateFileGenerator”。
What happens if you right click on the .tt file a choose 'Run Custom Tool'? Under properties for t4mvc.tt, you should see Custom Tool set to 'TextTemplatingFileGenerator'.
我尝试了以下操作,如果这对任何人有帮助:
我首先按照此处列出的步骤无法让 T4MVC 与 VS2010 和 ASP.NET MVC 2 一起使用
然后我尝试将 t4mvc.tt 文件中的语言从 <#@ template language="C#v3.5" debug="true" hostspecic="true" #> 更改为到 <#@ template language="C#" debug="true" hostspecific="true" #>并构建了解决方案
最后我回到了版本 2.6.15,将语言更改回 C#v3.5,删除了文本模板引用并再次构建了解决方案。
真的不知道是什么解决了这个问题,但现在已经解决了。我必须做的唯一手动更改是在 T4MVC.cs 文件中,T4MVC 生成器使用双引号代替右括号。
希望这对某人有帮助。
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.