Documentation Rules


The Xml within a C# element’s document header is badly formed.

Rule Description

C# syntax provides a mechanism for inserting documentation for classes and elements directly into the code, through the use of Xml documentation headers. For an introduction to these headers and a description of the header syntax, see the following article: http://msdn.microsoft.com/en-us/magazine/cc302121.aspx.

A violation of this rule occurs when the documentation Xml is badly formed and cannot be parsed. This can occur if the Xml contains invalid characters, or if an Xml node is missing a closing tag, for example.

How to Fix Violations

To fix a violation of this rule, replace the badly formed Xml with valid Xml that can be parsed by a standard Xml parser.

The following example shows a class containing invalid Xml within its documentation header. The closing tag for the <summary> node is invalid.

    /// <summary>

    /// An example of badly formed Xml.

    /// </summa3ry>

    public class Example