Compartilhar via


Como: Adicionar nova exceções

This topic applies to:

Edition

Visual Basic

C#

F#

C++

Web Developer

Express

O tópico é aplicável O tópico é aplicável O tópico é aplicável O tópico é aplicável O tópico é aplicável

Pro, Premium e Ultimate

O tópico é aplicável O tópico é aplicável O tópico é aplicável O tópico é aplicável O tópico é aplicável

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. Para interromper as exceções criadas na X.MyClass, por exemplo, você deve especificar X.MyClass, não apenas MyClass. Você também pode inserir X.MyClass`2 Parar no X.MyClass`2 , mas não 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.

Consulte também

Tarefas

Como: Interromper quando uma exceção é lançada.

Como: Break on User-Unhandled Exceptions

Conceitos

Tratamento de Exceção (Depuração)