c# - C# 中的 XML 多行注释 - 我做错了什么?

标签 c# visual-studio-2008 comments multiline xml-comments

根据 this article , 可以获得多行 XML 注释——而不是使用 /// , 使用 /** */ .这是我对多行注释的解释,以及我希望发生的事情:

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

但是,当我使用此表单时,当我将鼠标悬停在我的代码中的类名上时弹出的工具提示是单行的,即它看起来就像我这样写评论一样:

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

这种行为实际上在 VS2008 中仍然可能吗?

编辑

gabe 指出我误解了“多行”的意思,我实际上需要使用 <para><br>得到我想要的效果。我继续使用 <br>因为我想控制换行符发生的位置,即

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

当我在我的代码中查看此类的工具提示时,所有内容仍然在一行中结束...WTH?我在这里做错了什么吗?

更新

好的,我继续尝试 <para>在每一行上标记,这样就可以了。不知道为什么 <br/>没有。

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

最佳答案

试试这个

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

关于c# - C# 中的 XML 多行注释 - 我做错了什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2547327/

相关文章:

c# - 如何在C#中执行Go函数

c# - 使用 C# 进行 TEA 加密

visual-studio-2008 - Visual Studio 2008 安装项目 - 包括 .NET Framework 3.5

c# - Ctrl+R,Ctrl+R 命令不起作用

c# - 使用 C# 为数据表中的特定列赋值

visual-studio-2008 - SSRS : Getting a specific value from different rows of a dataset

CSS 注释导致奇怪的效果

c# - 使用 ReSharper 删除评论

python - Python 中的多行注释

c# - DataSet 是否具有 Contain 或 In 功能?