TypeName | SA1603DocumentationMustContainValidXml |
CheckId | SA1603 |
Category | Documentation Rules |
The Xml within a C# element's document header is badly formed.
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: https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/xmldoc/xml-documentation-comments.
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.
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
{
}
[SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1603:DocumentationMustContainValidXml", Justification = "Reviewed.")]
#pragma warning disable SA1603 // DocumentationMustContainValidXml
#pragma warning restore SA1603 // DocumentationMustContainValidXml