T4MVCVB不干净安装吗?

时间:2014-03-24 14:25:40

标签: vb.net t4mvc

我刚安装了T4MVCVB并且无法编译:

Error   1   Compiling transformation: Invalid token 'this' in class, struct, or interface member declaration    c:\...\T4MVCVB.tt   1   1
Error   2   Compiling transformation: Method must have a return type    c:\...\T4MVCVB.tt   1   6
Error   3   Compiling transformation: Type expected c:\...\T4MVCVB.tt   1   12

请注意,每个错误的行号都是1,因此根本无法查看它不喜欢的行。

我怎样才能找出问题所在,以便为VB生成类型化助手?

编辑:经过一些清理后,现在我收到以下编译错误,以及问题的行号:

Error   112 Running transformation: System.NotImplementedException: Not implemented (Exception from HRESULT: 0x80004001 (E_NOTIMPL))
at EnvDTE80.CodeFunction2.get_Attributes()
at  {long call stack}

它不喜欢的行是:

// Ignore methods that are marked as not being actions
if (GetAttribute(method.Attributes, "System.Web.Mvc.NonActionAttribute") != null)
    continue;

1 个答案:

答案 0 :(得分:1)

确保您使用的是为VB制作的最新版本。这是T4MVCVB Nuget Package

如果在生成.vb文件之前它还没有中断,我会在T4MVCVB.tt顶部附近取消注释这两行,看看你是否能找到问题所在位置。

//System.Diagnostics.Debugger.Launch();
//System.Diagnostics.Debugger.Break();