How to add a line break in C# .NET documentation
Solution 1:
You can use a <para />
tag to produce a paragraph break or you can wrap text in <para></para>
tags as a way to group the text and add the blank line after it, but there is no equivalent to <br />
or anything like that. (Which according to this old MS forum post is by design.) You can get the list of available tags in this documentation article from MS. Documenting your code
Example (based on original OP sample):
/// <summary>
/// <para>Get a human-readable variant of the SQL WHERE statement of the search element.</para>
/// Rather than return SQL, this method returns a string with icon-tokens, which
/// could be used to represent the search in a condensed pictogram format.
/// </summary>
Solution 2:
As of Visual Studio 2019, use <br/>
for newlines in comments.
Example:
/// <summary>
/// This is a comment.<br/>
/// This is another comment <br/>
/// This is a long comment so i want it to continue <br/> on another line.
/// </summary>
Notice that there is no extra line added when we use <br/>
instead of <para>
.
Solution 3:
This is my usage, like <br/>
, it's working :)
/// <summary>
/// Value: 0/1/2
/// <para/>0 foo,
/// <para/>1 bar,
/// <para/>2 other
/// </summary>