建议的用于文档注释的 XML 标记 (Visual Basic)Recommended XML Tags for Documentation Comments (Visual Basic)

Visual Basic 编译器可以在代码中将文档注释处理到 XML 文件中。The Visual Basic compiler can process documentation comments in your code to an XML file. 您可以使用其他工具将 XML 文件处理到文档中。You can use additional tools to process the XML file into documentation.

允许对代码构造(如类型和类型成员)使用 XML 注释。XML comments are allowed on code constructs such as types and type members. 对于分部类型,只有一个类型的部分可以有 XML 注释,尽管注释其成员没有限制。For partial types, only one part of the type can have XML comments, although there is no restriction on commenting its members.

备注

文档注释不能应用于命名空间。Documentation comments cannot be applied to namespaces. 原因是一个命名空间可以跨多个程序集,而不是所有程序集都必须同时加载。The reason is that one namespace can span several assemblies, and not all assemblies have to be loaded at the same time.

编译器将处理任何为有效 XML 的标记。The compiler processes any tag that is valid XML. 以下标记提供用户文档中的常用功能。The following tags provide commonly used functionality in user documentation.

<c> <code> <example>
<exception>1<exception> 1 <include>1<include> 1 <list>
<para> <param>1<param> 1 <paramref>
<permission>1<permission> 1 <remarks> <returns>
<see>1<see> 1 <seealso>1<seealso> 1 <summary>
<typeparam>1<typeparam> 1 <value>

(1 编译器验证语法。 ) (1 The compiler verifies syntax.)

备注

如果要在文档注释的文本中显示尖括号,请使用 &lt;&gt;If you want angle brackets to appear in the text of a documentation comment, use &lt; and &gt;. 例如,该字符串 "&lt;text in angle brackets&gt;" 将显示为 <text in angle brackets>For example, the string "&lt;text in angle brackets&gt;" will appear as <text in angle brackets>.

请参阅See also