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.
Application_start not working
Application_Start not firing?
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
Resetting IIS alone will not do the trick since the debugger is attached after Application_Start is triggered.
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#" %>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With