在下面的示例中, & 和 Δ 还好 Δ 不是(后两个都是Δ)。编译器发出的警告类似于:
&
Δ
Δ
warning CS1570: XML comment on 'XXX.DocumentedMethod()' has badly formed XML -- 'Reference to undefined entity 'Delta'.'
/// <summary> /// & Δ Δ /// </summary> public void DocumentedMethod() { }
XML注释支持哪些字符实体?
这不是评论的问题,而是XML本身。XML本身就知道 & , < , > , ' 和 " 以及数字实体。任何其他事情都必须明确声明。
<
>
'
"
见 section 4.6 of the spec 更多信息。