I currently have the following routines in my Global.asax.cs
file:
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRout
Maybe my solution will help someone:
RegisterRoutes
code (example - add\remove int i = 1;
).RegisterRoutes
.I hit with the same problem today and was using Local IIS.
I believe this arises because because of the way page is loaded. All you need to do is, put a breakpoint in Application_Start. Run the application(In my case, it took to Login Screen ) and then go to web.config. Edit it - by adding some spaces. and then refresh in Browser.that will hit the breakpoint on Application_Start.
project -> property -> web
check "Native code".
I found the following answer on forums.asp.net:
Are you using IIS7 as the server or the built-in web server? I noticed when using IIS7 that if you start the debugger, let a page come up, then change Global.asax (the markup file, not code-behind) while the debugger is still running, then refresh the page, breakpoints in Application_Start will be hit.
I think what's happening is that pressing "play", VS just fires up the process, then attaches to it, but by the time it attaches to it the start event has already run. By changing Global.asax, you cause the app to restart and since the debugger's already attached you can hit the breakpoint. Not a great solution, but it seems to work.
Thats's what was happening in my case.
I believe you have to shutdown/stop the local debugging server in order for the Application_Start()
event to fire again... you should be able to right click on it in the system tray and choose "Stop".
In my case was I using
Local IIS Web server in web project settings
and I change to Use Visual Studio Development Server, and this works.