TypeName | SA1627DocumentationTextMustNotBeEmpty |
CheckId | SA1627 |
Category | Documentation Rules |
The Xml header documentation for a C# code element contains an empty tag.
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 header for an element contains an empty tag. For example:
/// <summary>
/// Joins a first name and a last name together into a single string.
/// </summary>
/// <remarks></remarks>
/// <param name="firstName">Other part of name.</param>
/// <param name="lastName">Part of the name.</param>
/// <returns>The joined names.</returns>
public string JoinNames(string firstName, string lastName)
{
...
}
To fix a violation of this rule, add documentation text within the empty tag.
[SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1627:DocumentationTextMustNotBeEmpty", Justification = "Reviewed.")]
#pragma warning disable SA1627 // DocumentationTextMustNotBeEmpty
#pragma warning restore SA1627 // DocumentationTextMustNotBeEmpty