我不能让T4MVC的当前版本(02年2月6日)与ASP.NET MVC 2项目在VS2010测试版反编译.NET 4中工作2T4MVC是否可以与Visual Studio 2010 Beta 2和.Net 4一起使用?
有一个错误:
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.
有其他人遇到此?
是的,该模板生成一旦你建立应用程序所需的代码 – 2009-12-08 15:43:55
我有同样的问题,但我似乎无法得到它的工作。当我构建时,我会收到与“命名空间canot直接...”相同的消息,并且当我打开生成的.cs文件时,它只会显示“生成代码错误”。没有我做的似乎帮助... – 2009-12-15 09:44:17
删除所有.generated.cs文件,做一个生成,然后打开.tt文件并保存(它应该重新生成一切)。此外,它看起来像作者本人(David Ebbo)在这里,所以也许如果你发布一些他可以帮助的信息。 – Jedidja 2009-12-15 12:55:20