Changing How the Debugger Handles Exceptions (Windows CE 5.0)

Send Feedback

When an exception occurs, the debugger writes an exception message to the Output window. The debugger can also break execution of the program when an exception occurs, giving you a chance to debug it.

You can choose whether you want the debugger to break on a given type of exception or on a category of exceptions.

To change how the debugger handles an exception or category of exceptions

  1. From the Debug menu, click Exceptions.

    The Exceptions dialog box opens.

  2. In the Exceptions list, use the tree control to select the individual exception or category of exceptions whose handling you want to change.

  3. Under When the exception is thrown, do one of the following:

    • If you want execution to break as soon as the exception occurs, without giving the handler a chance to execute, choose Break into the debugger.

      If you choose this setting, the icon next to the exception or category name appears as a large red ball with an X through it.

    • If you want to give the handler a chance to fix the problem, choose Continue.

      If you choose this setting, the icon next to the exception or category name appears as a large gray ball.

    • If you want to accept the default setting currently specified for the category that the exception is part of, choose Use parent setting.

      This option is not available if you chose a category, rather than an individual exception, in step 2.

      If you choose this setting, the icon next to the exception or category name appears as a small gray ball.

  4. Under If the exception is not handled, do one of the following:

    • If you want execution to break after the handler executes if the handler is not successful in fixing the problem, choose Break into the debugger.

    • If you want execution to continue after the handler executes, regardless of whether the handler is successful, choose Continue.

      **Note  ** You cannot continue after an exception in managed code. Choosing Continue after an exception in managed code causes debugging to stop.

    • If you want to accept the default setting currently specified for the category that the exception is part of, choose Use parent setting.

      This option is not available if you chose a category, rather than an individual exception, in step 2.

  5. Choose the option.

  6. Click OK.

When the debugger breaks on an exception, you can look at the source window to see where the exception occurred and use the Watch window or QuickWatch dialog box to see variable contents.

See Also

Handling an Exception | Exceptions Dialog Box

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.