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.

bee

Author

david

comments powered by Disqus

Categories

Recent Tweets

Retweeted by @dyardy Hey C# peeps, we’re trying C# in browser with reference content. Try it here: docs.microsoft.com/dotnet/csharp/… reply with feedback /cc @LadyNaggaga
23 Amazing Vintage Photographs Taken Inside WWII Tank Factories ~ vintage everyday vintag.es/2017/10/23-ama…
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… twitter.com/i/web/status/9…