views:

61

answers:

5

I have a strange error. I'm debugging an asp.net site and suddenly it stops. Visual Studio stays in debug mode and my web application stays on running just fine. I found this post on, but I don't think a background thread is causing the problem. There's even a try catch around the code where it usually stops debugging, but the catch is not triggered... Everytime I try it, it stops at a different place in the code.

+1  A: 

Add a breakpoint in Application_Error Event in the Global.asax.

Amitabh
+1  A: 

Check mode in your ide its set to Debug not to Release.

Because cannot able to debug your application if it set to Release mode.

check for detail : http://msdn.microsoft.com/en-us/library/e8z01xdh(VS.80).aspx

Pranay Rana
+3  A: 

Have you tried hitting the Pause || button? This will pause the debugger wherever it is executing, so if you are in an infinite loop outside of your try catch block, you will be able to find out where.

Daniel Dyson
+2  A: 

Have you set your debugger to break on all exceptions, not just unhandled exceptions?

Debug -> Exceptions -> Check the "Thrown" box for everything (or at least just Common Language Runtime Exceptions). If an exception is thrown during debugging, on any thread, this should cause the debugger to highlight and break on the "thrower".

Another thing to try, is to reset all your IDE settings. I've had various odd behaviours before where settings got corrupted and the IDE stopped behaving sensibly: Tools -> Import and Export Settings -> Reset All Settings.

In addition to Daniel Dyson's answer - if you "pause" as he suggests (once the debugging has "stopped"), open the "Threads" debug window. Are there any threads showing that have an entry in the "location column". If so, this is probably your code executing. Click on each in turn. Can you account for what each thread is doing, or does this shed any light on this odd behaviour?

Rob Levine
+1  A: 

Make sure the "Ping Enabled" setting is set to "False" in the IIS configuration.

In IIS7, right-click on your AppPool, choose "Advanced Settings," navigate down to the Ping Enabled setting and change it to false.

If you're using IIS6, the setting is slightly different. I believe it's called "Ping Interval" if I remember correctly and it's set to a number of seconds.

Nate Dudek