t4mvc

T4MVC Bug In generated code (Identifier expected)


I have just installed T4MVC in a new project and I am having the following error:
(I have used T4MVC in previous projects and never had this issue)

CS1001: Identifier expected

The error come from this generated code (in file 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; }
}

The method WriteFile is missing the identifier for System.Web.HttpResponseBase paremeter.
Someone having the same issue? There is a fix available?


Solution

  • This is a known VS issue that was fixed in a VS patch. Simply install from https://msdn.microsoft.com/en-US/library/mt634751(VS.140).aspx and it'll take care of it.

    See also https://github.com/T4MVC/T4MVC/issues/67.