Click to Rate and Give Feedback
MSDN
MSDN Library
Visual Studio .NET
Reference
Visual C# Language
XML Documentation
 <exception>
This page is specific to
Microsoft Visual Studio 2003/.NET Framework 1.1

Other versions are also available for the following:
C# Programmer's Reference
<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

© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker