locked
Setup Debug -> Exceptions in a way that it only breaks on exceptions that are not explicitly handeled in a try/catch RRS feed

  • Question

  • I don't seem to get it; since using Visual Studio 2010, I keep seeing exceptions writtin to the output window without the debugger pausing and letting you see what's going wrong; this never used to be a problem in previous versions of visual studio. I've resorted to have the debugger break on every error, but in some cases this is just unpractical.

    What I'd like Visual Studio to do is always break if an exception is raised (check the Throw checkbox in the Ctrl-Alt-E window), except when it is handeled in user code (try..catch), the behaviour I expect (and have gotten from previous versions of Visual Studio).

    Thanks in advance,

    Nick.

    Saturday, September 11, 2010 9:05 PM

Answers

  • I've tried all the combo's, it doesn't work. If I uncheck Throw, it doesn't matter if I check user unhandeled or not; it won't break.
    Try to calll System.Diagnostics.Debugger.Break() in your source code, Visual Studio should break on exactly this line when debugging.
    • Marked as answer by liurong luo Monday, September 20, 2010 1:58 AM
    Tuesday, September 14, 2010 4:53 AM

All replies

  • Check your setting for Debug | Exceptions.

    Ensure the Thrown column is checked for the Comon Language Runtime Exceptions row if you want the debugger to stop when an exception is thrown, even if there is a try/catch block to catch it.

    Ensure the value is unchecked if you want your exceptions to be cause by your Try/Catch blocks.

    Hope this helps.


    www.insteptech.com ; msmvps.com/blogs/deborahk
    We are volunteers and ask only that if we are able to help you, that you mark our reply as your answer. THANKS!
    Sunday, September 12, 2010 12:51 AM
  • Check your setting for Debug | Exceptions.

    Ensure the Thrown column is checked for the Comon Language Runtime Exceptions row if you want the debugger to stop when an exception is thrown, even if there is a try/catch block to catch it.

    Ensure the value is unchecked if you want your exceptions to be cause by your Try/Catch blocks.

    Hope this helps.


    www.insteptech.com ; msmvps.com/blogs/deborahk
    We are volunteers and ask only that if we are able to help you, that you mark our reply as your answer. THANKS!

    I've tried all the combo's, it doesn't work. If I uncheck Throw, it doesn't matter if I check user unhandeled or not; it won't break.
    Sunday, September 12, 2010 8:57 AM
  • I've tried all the combo's, it doesn't work. If I uncheck Throw, it doesn't matter if I check user unhandeled or not; it won't break.
    Try to calll System.Diagnostics.Debugger.Break() in your source code, Visual Studio should break on exactly this line when debugging.
    • Marked as answer by liurong luo Monday, September 20, 2010 1:58 AM
    Tuesday, September 14, 2010 4:53 AM