“ASP.global_asax does not exist in the namespace ASP”

后端 未结 9 2188
梦毁少年i
梦毁少年i 2020-12-23 08:56

I created a RazorFunctions.cshtml file on App_Code

@functions {
    public static string GetActiveClassIf(string controllerName, string actionName = null)
           


        
9条回答
  •  有刺的猬
    2020-12-23 09:49

    Two things i did to resolve this was to re-target the framework and then changing it back (was using 4.5.1 changed it to 4.5 and back)

    After this i had a lot of error with T4MVC which i was also using, i upgraded it to newest version but i could see that in source control that T4MVC was installed targeting framework 4.5 and when you re/install a new nuget package it changes the target framework, so that was changed to 4.5.1

    After this everything worked. I didn't test if you only need to do that second part of this answer, but i would try that first.

提交回复
热议问题