Skip to content

Latest commit

 

History

History
55 lines (41 loc) · 1.81 KB

SA1603.md

File metadata and controls

55 lines (41 loc) · 1.81 KB

SA1603

TypeName SA1603DocumentationMustContainValidXml
CheckId SA1603
Category Documentation Rules

⚠️ This rule has been intentionally omitted from StyleCop Analyzers. See KnownChanges.md for additional information.

Cause

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: 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.

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
{
}

How to suppress violations

[SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1603:DocumentationMustContainValidXml", Justification = "Reviewed.")]
#pragma warning disable SA1603 // DocumentationMustContainValidXml
#pragma warning restore SA1603 // DocumentationMustContainValidXml