ASP.NET Application_Start Never Fires (…or so it seems)

Even though I’ve been doing ASP.NET for 8 years, I never realized until today that when you put a breakpoint in Application_Start in Global.asax, it may never be hit.  The reason, I discovered, is that the debugger doesn’t have time to attach to the web application before Application_Start finishes.  To get around this, you can force your application to restart after the debugger has had a chance to attach by simply editing and saving a change the web.config.  This causes the application to restart and your breakpoints in Application_Start will now be hit.

comments powered by Disqus

Get weekly updates in your inbox!