Asp – What could cause ASP.NET to skip lines in debug

asp.netdebuggingvisual-studiovisual-studio-2008

I never had this problem before, but I reinstalled my computer recently and Visual Studio is not behaving well in debug for an ASP.NET site.

I am attaching visual studio 2008 to the w3wp process to debug a website. When I am debugging a method line by line with F10, sometimes visual studio will decide that it continues until it encounter a breakpoint… It's almost like if I pressed F5 to let it continue, but I press F10. For example if a method call is called more than once and there's a breakpoint at the beginning, while I am debugging line by line inside the method sometimes the execution will continue to the breakpoint at the beginning for no apparent reason so I lose all my debugging…

Anyone had this problem before?

Thanks,

Best Solution

I have the same problem, whenever I press step-into or step-over it continues to execution as if I pressed F5. Debugging is working only if I put a break point on every line I wish to evaluate. Is anyone else experiencing this besides me and the poster?

I've tried re-installing VS and everything but that didn't help. Furthermore, debugging does work in some other projects, to be specific WinForms projects, and when I press step into on the webservice call and "attach", debugging still works as it should.


OK, Update... I have found that my problem lies with Optimizations in compilation. I had optimizations turned on in debug configuration.

Make sure you uncheck that for debug configuration on all your projects and their references.

Also try: http://social.msdn.microsoft.com/Forums/en-US/vsdebug/thread/f3fcb4fb-8a08-4fa0-8d58-9ed6f3eb1193