This documentation is archived and is not being maintained.

How to: Add New Exceptions

This topic applies to:


Visual Basic



Web Developer


Topic appliesTopic appliesTopic appliesTopic applies


Topic appliesTopic appliesTopic appliesTopic applies

Pro and Team

Topic appliesTopic appliesTopic appliesTopic applies

Table legend:

Topic applies


Topic does not apply

Does not apply

Topic applies but command hidden by default

Command or commands hidden by default.

By default, the Exceptions dialog box lists the most common exceptions in each category. You can add other exceptions to a category. Visual Studio saves the list of added exceptions with the project data, so the exceptions will be available the next time you open and run the project.

The Exceptions dialog box provides limited support for generic exception types in C#, but not Visual Basic. To break on exceptions created from X.MyClass, for example, you must specify X.MyClass, not just MyClass. You can also enter X.MyClass`2 to stop on X.MyClass`2 but not X.MyClass`4.

To add an exception to the Exceptions dialog box

  1. In the Exceptions dialog box, click the Add button.

  2. In the New Exception dialog box, choose a category of exceptions from the Type list.

  3. Type the name of the exception in the Name box.

    Exception names are not case sensitive, so "CustomException" and "customexception" represent the same exception.

  4. Click OK.