生成代码中的 T4MVC 错误(需要标识符)
T4MVC Bug In generated code (Identifier expected)
我刚刚在新项目中安装了 T4MVC,但出现以下错误:
(我在之前的项目中使用过T4MVC,从来没有出现过这个问题)
CS1001: Identifier expected
错误来自此生成的代码(在文件 T4MVC.cs 中):
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
internal partial class T4MVC_System_Web_Mvc_FileResult : System.Web.Mvc.FileResult, IT4MVCActionResult
{
public T4MVC_System_Web_Mvc_FileResult(string area, string controller, string action, string protocol = null): base(" ")
{
this.InitMVCT4Result(area, controller, action, protocol);
}
protected override void WriteFile(System.Web.HttpResponseBase ) { }
public string Controller { get; set; }
public string Action { get; set; }
public string Protocol { get; set; }
public RouteValueDictionary RouteValueDictionary { get; set; }
}
方法 WriteFile
缺少 System.Web.HttpResponseBase
参数的标识符。
有人有同样的问题吗?
有可用的修复程序吗?
这是一个已知的 VS 问题,已在 VS 补丁中修复。只需从 https://msdn.microsoft.com/en-US/library/mt634751(VS.140).aspx 安装即可。
我刚刚在新项目中安装了 T4MVC,但出现以下错误:
(我在之前的项目中使用过T4MVC,从来没有出现过这个问题)
CS1001: Identifier expected
错误来自此生成的代码(在文件 T4MVC.cs 中):
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
internal partial class T4MVC_System_Web_Mvc_FileResult : System.Web.Mvc.FileResult, IT4MVCActionResult
{
public T4MVC_System_Web_Mvc_FileResult(string area, string controller, string action, string protocol = null): base(" ")
{
this.InitMVCT4Result(area, controller, action, protocol);
}
protected override void WriteFile(System.Web.HttpResponseBase ) { }
public string Controller { get; set; }
public string Action { get; set; }
public string Protocol { get; set; }
public RouteValueDictionary RouteValueDictionary { get; set; }
}
方法 WriteFile
缺少 System.Web.HttpResponseBase
参数的标识符。
有人有同样的问题吗?
有可用的修复程序吗?
这是一个已知的 VS 问题,已在 VS 补丁中修复。只需从 https://msdn.microsoft.com/en-US/library/mt634751(VS.140).aspx 安装即可。