I have an old MVC application that was built using Visual Studio 2010. I then upgraded to MVC 5 using Visual Studio 2013 and upgraded the NuGet packages. It builds, but when I run the application through Visual Studio it cannot find the home view. I traced it back to the the Global.asax and found out the Application_Start is never called and routes are never set then.
I have found a few questions asked here about this problem, but none of the solutions have worked for me.
This seems so simple, but I can't find a solution to this. Any ideas?
I faced this issue few times and have tried many workarounds. what worked for me is,
Solution 2
The same happened to me, Global.asax.cs is not being called at all...
As for my case, the Inherits
attribute was missing in Global.asax
<%@ Application Codebehind="Global.asax.cs" Language="C#" %>
So after I changed it like so, it works!
<%@ Application Codebehind="Global.asax.cs" Inherits="MyAwesomeApp.MvcApplication" Language="C#" %>
Resetting IIS alone will not do the trick since the debugger is attached after Application_Start is triggered.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.