Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Debugging asp.net suddenly stops

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.

like image 218
Lieven Cardoen Avatar asked Jun 17 '10 12:06

Lieven Cardoen


1 Answers

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?

like image 85
Rob Levine Avatar answered Oct 16 '22 11:10

Rob Levine