如何将<>包含的项添加到文档注释中

Sco*_*ain 6 .net c# documentation comments visual-studio-2008

我正在尝试编写文档注释但是我遇到了问题.

/// <summary>
/// Inserts an element into the System.Collections.Generic.List<T> at the specified
/// index.
/// </summary>
Run Code Online (Sandbox Code Playgroud)

当我到达<T>Visual工作室时,我认为我正在尝试添加另一个标签.添加这样的评论的正确方法是什么(如果我可以在生成的帮助文本中点击它们,这将是一个额外的奖励)

Tim*_*son 10

C#文档注释XML,所以更改<>&lt;&gt;.

你做得最好的是使用<see>标签插入超链接.在<see>标记中,更改<T>{T}:

/// <summary>
/// Inserts an element into the <see cref="List{T}"/> at the specified
/// index.
/// </summary>
Run Code Online (Sandbox Code Playgroud)

(请注意cref,与普通文本不同,编译器会对该属性进行语法检查.)