The breakpoint will not currently be hit – Visual Studio Debugging

Debugging your application is a great way to find the cause of a problem. However you may sometime encounter the dreaded “The breakpoint will not currently be hit. No symbols have been loaded for this document.” error. You can find fixes to this problem by following this link.

If like me, none of the above methods work for you, then there could be something else that’s preventing the debugger from working. So I tried creating a new application (web) using Visual Studio 2010 and set a breakpoint to see if it works. As soon as I start debugging from VS2010, the ASP.NET Web Development server kicks in and tries to open the webpage and then switches back to visual studio on my breakpoint. This means that debugging should work fine. I tried it on Firefox and Internet Explorer but it doesn’t work though. By that time, I’ve come to the conclusion that the debugger is not attaching itself correctly to the web server which is hosting my application. Note that the default web server that comes with visual studio opens the webpage either in Firefox or Internet Explorer but uses something like localhost:45609 to accomplish that.

My web app was hosted on IIS7.5 under Windows 7 and I had to attach the debugger to w3wp.exe worker process responsible for requests. Once this is done, the breakpoints work like a charm.

comments powered by Disqus