Chapter 21. XML Documentation Tag Reference

Table 21-1 lists the predefined set of XML tags that can be used to mark up the descriptive text. Table 21-2 lists possible prefixes for type and member cross-references.

Table 21-1. Predefined XML tags

Tag

Description

<summary>

<summary>description</summary>

Describes a type or member. Typically, this contains the description of a member at a fairly high level.

<remarks>

<remarks>description</remarks>

Provides additional information regarding a particular member. Information about side effects within the method, or particular behavior that may not otherwise be intuitive (such as the idea that this method may throw an ArrayOutOfBoundsException if a parameter is greater than 5) should be listed here.

<param>

<param name="name">description</param>

Describes a parameter on a method. The name attribute is mandatory and must refer to a parameter on the method. If this tag is applied to any parameter on a method, all parameters on that method must be documented. You must enclose name in double quotation marks (“”).

<returns>

<returns>description</returns>

This tag describes the return values for a method.

<exception>

<exception [cref="type"]>description</exception>

Describes the exceptions a method may throw. If present, the optional cref attribute should refer to the type of exception. You must enclose type in double quotation marks (“”).

<permission>

<permission [cref="type"]>description</permission>

Describes the ...

Get C# in a Nutshell, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.