Debug IIS/global.asax within Visual Studio

Taken from this SO answer

You may create a post-build event which changes the timestamp of a web.config file. I used a touch.exe tool from http://www.stevemiller.net/apps/. You also need to set the “Run the post-build event” to Always.

With this option set anytime you start the debugger, web.config timestamp is getting updated causing application (thus IIS pool) restart on the first request – but at this point you are already attached to this process so your Application_ event breakpoints should work.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.