Export (0) Print
Expand All

<exception>

<exception cref="member">description</exception>

where:

cref = "member"
A reference to an exception that is available from the current compilation environment. The compiler checks that the given exception exists and translates member to the canonical element name in the output XML. member must appear within double quotation marks (" ").
description
A description.

Remarks

The <exception> tag lets you specify which exceptions can be thrown. This tag is applied to a method definition.

Compile with /doc to process documentation comments to a file.

Example

// xml_exception_tag.cs
// compile with: /doc:xml_exception_tag.xml
using System;

/// comment for class
public class EClass : Exception 
{
   // class definition ...
}

/// <exception cref="System.Exception">Thrown when... .</exception>
class TestClass 
{
   public static void Main() 
   {
      try 
      {
      }
      catch(EClass) 
      {
      }
   }
}

See Also

Recommended Tags for Documentation Comments

Show:
© 2014 Microsoft