根据这篇文章,可以获得多行XML注释 - 而不是使用///,使用/** */.这是我对多行注释的解释,以及我想要发生的事情:
/**
* <summary>
* this comment is on line 1 in the tooltip
* this comment is on line 2 in the tooltip
* </summary>
*/
Run Code Online (Sandbox Code Playgroud)
但是,当我使用这个表单时,当我将鼠标悬停在我的代码中时弹出的工具提示是单行的,即它看起来就像我写了这样的评论:
/// <summary>
/// this comment is on line 1 in the tooltip
/// this comment is on line 2 in the tooltip
/// </summary>
Run Code Online (Sandbox Code Playgroud)
这种行为实际上是否仍然可以在VS2008中使用?
编辑
gabe指出我误解了"多线"意味着什么,我实际上需要使用<para>或<br>获得我想要的效果.我继续使用,<br>因为我想控制断线发生的位置,即
/// <summary>
/// this comment is on line 1 in …Run Code Online (Sandbox Code Playgroud) 如果我<para></para>在C#中使用该语句///summary,我会得到一个空行,然后文本继续,这相当于两个换行符(<br/>或\n).
但是我真的想添加单个换行符,这只会导致我的文本从下一行开始,而不会在它们之间留下空白行.
建议的解决方案对我不起作用,请参见屏幕截图: 两个换行符
更新:我正在使用带有Visual Assist插件的Visual Studio 2015,不对任何智能格式选项进行手动更改.
更新2:它不是由Visual Assist插件引起的(我禁用了它).在VS2015中似乎完全不同.