我尝试了所有可能性:卸载T4MVC,安装另一个版本,更改前缀,从.tt文件http://hadsy.net/2011/05/17/CompilingTransformationInvalidTokenThisInClassStructOrInterfaceMemberDeclaration.aspx删除最后一行,我也有BaseController摘要,更新Visual Studio。仅生成此(不对所有控制器执行任何操作,也不为BaseController生成任何内容):
公共类AccountController {
static readonly ViewsClass s_views = new ViewsClass();
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public ViewsClass Views { get { return s_views; } }
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public class ViewsClass
{
static readonly _ViewNamesClass s_ViewNames = new _ViewNamesClass();
public _ViewNamesClass ViewNames { get { return s_ViewNames; } }
public class _ViewNamesClass
{
public readonly string Login = "Login";
}
public readonly string Login = "~/Views/Account/Login.cshtml";
}
}
在我更改动作并重新运行工具崩溃之后,最初T4MVC正常工作。我创建了另一个项目解决方案来测试T4MVC并且正常工作。有什么想法来解决这个问题?