views:

64

answers:

2

I'm using VS2010 in C#

there is a place in my code where an exception is thrown and properly handled.

the problem is that I'd like to configure the debugger to break on all exceptions, handled or not - all exceptions but this one. My goal is to see all the thrown exceptions in the debugger, but this one exception is driving me bonkers as it hits somewhat often

I'd love some kind of #pragma trick?

+7  A: 

Go to the Debug menu, select Exceptions.... Expand the Common Language Runtime Exceptions category and either uncheck the specific exception if it's there or if it's not, you can add it via the Add... button on the bottom right side (type in the full class name).

CMerat
I'm hoping to remove just this instance, not all exceptions of this type? any idea there?
stuck
I'd be pretty surprised if there was a way to ignore just one exception. I looked into something similar a few months ago and didn't find anything in a timely manner, so I resorted to changing the exception type (my code was throwing, not a third party) and just ignoring that specific type.
CMerat
+3  A: 

Look in the Visual Studio Debug menu under "Exceptions". The dialog that pops up should allow you to configure the type of behavior you're looking for.

Chris Koenig
Check "Thrown", which will allow you to break on handled as well as unhandled exceptions.
harpo