我无法让当前版本的 T4MVC (2.6.02) 与在 VS2010 Beta 2 中针对 .NET 4 编译的 ASP.NET MVC 2 项目一起使用。
有一个错误:
The C# 2.0 and C# 3.5 compilers are no longer supported. Templates will always be compiled with the version 4 compiler instead of 'v3.5' as specified.
这很容易通过改变来修复
<#@ template language="C#v3.5" debug="true" hostspecific="true" #>
到
<#@ template language="C#" debug="true" hostspecific="true" #>
然后.generated.cs
创建文件,但是我收到一个编译错误,T4MVC.cs
其中说
error CS0116: A namespace cannot directly contain members such as fields or methods.
有没有其他人经历过这个?