<exception cref="member">description</exception>
对可从当前编译环境中获取的异常的引用。编译器检查到给定异常存在后,将 member 转换为输出 XML 中的规范化元素名。必须将 member 括在双引号 (" ") 中。
有关如何创建对泛型类型的 cref 引用的更多信息,请参见 <see>(C# 编程指南)。
异常的说明。
<exception> 标记使您可以指定哪些异常可被引发。此标记可用在方法、属性、事件和索引器的定义中。
使用 /doc 进行编译可以将文档注释处理到文件中。
// compile with: /doc:DocFileName.xml /// comment for class public class EClass : System.Exception { // class definition... } /// comment for class class TestClass { /// <exception cref="System.Exception">Thrown when...</exception> public void DoSomething() { try { } catch (EClass) { } } }