
154
|
Chapter 5, Debugging
#38 Customize Visual Studio’s Reaction to Exceptions
HACK
Setting checked, which means that, by default, changing the behavior of an
exception will propagate those changes to its derived exceptions.
Add Custom Exceptions
The Exceptions dialog allows you to change the debugger’s behavior when
working with system-defined exceptions, but you may want to tailor the
behavior of custom exception types you have created. To accomplish this,
select the topmost item in the tree of exceptions—Common Language Runt-
ime Exceptions—and click the Add button. This will display a dialog
prompting you to enter the name of your custom exception (see
Figure 5-17). The exception name is case insensitive, but be sure to enter the
fully qualified name of your exception, including the namespace.
Once a custom exception has been added to the list, you can remove it by
selecting the exception and clicking the Delete button; you can remove all
custom exceptions by clicking the Clear All button.
Quickly Finding Exception Names
While the Exceptions dialog lists the Common Runtime Language excep-
tions in an easy-to-navigate tree, there may be times when you don’t know
where in the tree the exception resides, or you may know the name of the
exception and don’t want to have to scroll through the tree interface. Fortu-
nately, the Exceptions dialog offers a Find button that, when clicked, will
prompt you for ...