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

别说谁变了你拦得住时间么 提交于 2019-11-27 23:27:32

It sounds like you are confused about what "multi-line" means. A single-line comment ends at the end of the line of source code, and if you want to continue that comment you must put a "///" on the next line. A multi-line comment starts with a "/*" and ends with a "*/" so it can end either on the same line or multiple lines down.

Being "multi-line" says nothing about any how the text within the comment is displayed. To put a line break in an XML comment you must insert a <br/> ("break") or wrap the line in a <para> ("paragraph") tag.

Try this

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

Add <br/> for line breaks or enclose the paragraphs in <para>...</para>. It's just like XML and HTML, the line break is nothing but whitespace.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!