T4MVC错误生成的代码(预期的标识符)

时间:2016-03-11 08:30:02

标签: t4mvc

我刚刚在一个新项目中安装了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参数的标识符 有人有同样的问题吗? 有可用的修复方法吗?

1 个答案:

答案 0 :(得分:1)

这是在VS补丁中修复的已知VS问题。只需从https://msdn.microsoft.com/en-US/library/mt634751(VS.140).aspx开始安装,它就可以处理它。

另见https://github.com/T4MVC/T4MVC/issues/67