XML multiline comments in C# - what am I doing wrong?

Dave picture Dave · Mar 30, 2010 · Viewed 13.4k times · Source

According to this article, it's possible to get multiline XML comments -- instead of using ///, use /** */. This is my interpretation of what multiline comments are, and what I want to have happen:

/**
 * <summary>
 * this comment is on line 1 in the tooltip
 * this comment is on line 2 in the tooltip
 * </summary>
 */

However, when I use this form, the tooltip that pops up when I hover over my class name in my code is single-line, i.e. it looks exactly as if I had written my comment like this:

/// <summary>
/// this comment is on line 1 in the tooltip
/// this comment is on line 2 in the tooltip
/// </summary>

Is this behavior actually possible still in VS2008?

EDIT

gabe pointed out that I have misunderstood what "multiline" means, and I actually need to use <para> or <br> to get my intended effect. I went ahead and used <br> because I want to control where the line breaks occur, i.e.

/// <summary>
/// this comment is on line 1 in the tooltip<br/>
/// this comment is on line 2 in the tooltip<br/>
/// </summary>

When I look at the tooltip for this class in my code, everything still ends up on one line... WTH? Did I do something wrong here?

UPDATE

Ok, I went ahead and tried the <para> tag on each line, and that works. Not sure why <br/> doesn't.

/// <summary>
/// <para>this comment is on line 1 in the tooltip</para>
/// <para>this comment is on line 2 in the tooltip</para>
/// </summary>

Answer

bic picture bic · Mar 30, 2010

Try this

/// <summary>
/// this comment is on line 1 in the tooltip
/// <para>this comment is on line 2 in the tooltip</para>
/// </summary>