80

Does anyone know how to insert a line break into a summary comment in order for the line break to be reflected in Intellisense documentation?

To clarify, assume code documentation..

/// <summary>
/// Some text documentation
///  - a line break - 
/// Some more documentation
/// </summary>
public void SomeMethod() { }

So when using this method Intellisense offers a summary for the method formatted like this:

Some text documentation

Some more documentation

(Note - the 'para' tag doesn't create empty line breaks - I've tried it!)

boatcoder
  • 17,525
  • 18
  • 114
  • 178
flesh
  • 23,725
  • 24
  • 80
  • 97
  • A "para" is half answer (it's actually double break), beginning and end of line gets truncated. To enforce break a line at the beginning and the end of summary add following "" ( character get omitted - actually non visible and zero space). – SoLaR Mar 17 '18 at 09:14
  • 2
    As of Visual Studio 2019, you can add line breaks using `
    ` in xml documentation. Refer the answer [here](https://stackoverflow.com/a/57734549/12001603).
    – Mahipal Sep 18 '19 at 14:32

5 Answers5

77

Try using this.

/// <summary>
/// <para>Paragraph 1.</para>
/// <para>Paragraph 2.</para>
/// </summary>

But I don't think you can have an actual empty line. Empty para tag gets ignored.

Brian Kim
  • 24,916
  • 6
  • 38
  • 26
47

Try this:

/// <summary>
/// <para> [Non-Breaking Space] </para>
/// </summary>

[Non-Breaking Space] is obtained using Alt+255 (using the Numpad).

It will show up as an empty new line. I know this is old, but it worked for me today.

Jesse
  • 8,605
  • 7
  • 47
  • 57
theKRAY
  • 710
  • 6
  • 7
28
/// <summary><br />
/// <para>To treat comment line like a DIV tag, surround them with PARA tags.</para><br />
/// <para>To add a break with whitespace, add the following line:</para><br />
/// <para>&#160;</para><br />
/// </summary>
Samuel
  • 85
  • 1
  • 1
  • 10
7

Your only hope is probably something cludgy like this:

/// <summary>
/// <para>line one</para>
/// <para>_</para>
/// <para>line two</para>
/// </summary>
Andrew Hare
  • 344,730
  • 71
  • 640
  • 635
-3

Well, it is Xml. Maybe &#10;&#13;

Joel Coehoorn
  • 399,467
  • 113
  • 570
  • 794