Briefly:
In Visual Studio 2008, the Debug
menu has an Exceptions...
option.
When clicking this, it brings up the "Break when an exception is thrown" dialog, wherein I tick the box next to "Common Language Runtime Exceptions".
I want to be able to tick / untick this box programatically.
Elaboration:
This causes the debugger to break when any CLR exception is thrown (not when it's caught and re-thrown), so this is great for troubleshooting.
The problem is, it catches all CLR exceptions, and the .NET framework happens to throw and catch a bunch of exceptions internally, which also get caught. This causes the debugger to break on a bunch of exceptions which I really don't care about as they are internal to the framework and not a problem.
WCF is particularly bad at this, and as fortune has it, my app uses WCF all over the place.
What I'd like to do, is have the checkbox turned off, and once my app has started up (and got past the WCF connection phase and all the internal exceptions), then have it turned on, to break on all exceptions from now on.
- I know I don't have to have the blanket catch on "all clr exceptions", however the list of possible exceptions is about 2 miles long and it takes forever to scroll through and pick the ones you want (and then what if I miss some).