Debugging Application_Start()

Today, I was trying to hit a breakpoint within global.asax in a .NET 4.6 MVC project. Typically, I would be using Visual Studio, open up the code and place my breakpoint and hit F5 (or I much prefer to use AttachToAny extension and attach to the w3c process).  After I do this I run and VS.NET will stop on my breakpoint.  Well today things were acting more stubborn.  The application would not break, even after recycling IIS.

The solution, was to place my breakpoint like normal in the code. Start the application either with F5 (run with debug) or attach to the process.  Then make a modification (like adding a space) within the global.asax file then hit another page.

Presto.  This small change to the asax file (not the code behind global.asax.cs) cause the application to be rebuilt from scratch and it hit the breakpoint to allow me to step through the code of interest.




comments powered by Disqus


Recent Tweets

Retweeted by @dyardy Hey C# peeps, we’re trying C# in browser with reference content. Try it here:… reply with feedback /cc @LadyNaggaga
23 Amazing Vintage Photographs Taken Inside WWII Tank Factories ~ vintage everyday…
When is AI NOT Search? Artificiality intelligence==Search Engine (there cases when this is not true)
@projectedxyz Large data vs big data? Industry has so misused buzz words to sell products, and so you end up nothi……