I created a RazorFunctions.cshtml file on App_Code
@functions {
public static string GetActiveClassIf(string controllerName, string actionName = null)
I had the same issue.
I manually edited the generated file file.cshtml.72cecc2a.cs (it was at AppData\Local\Temp\Temporary ASP.NET Files\root) and changed ASP.global_asax to System.Web.HttpApplication and the error went away.
This is the generated code:
protected static ASP.global_asax ApplicationInstance {
get {
return ((ASP.global_asax)(Context.ApplicationInstance));
}
}
I changed it to:
protected static System.Web.HttpApplication ApplicationInstance {
get {
return ((System.Web.HttpApplication)(Context.ApplicationInstance));
}
}
I don't know why this is happening though.