What are the supported character entities for XML comments?
-
19-09-2019 - |
Question
In the following example, &
and Δ
are OK but Δ
is not (the latter two are both Δ). The compiler issues a warning similar to:
warning CS1570: XML comment on 'XXX.DocumentedMethod()' has badly formed XML -- 'Reference to undefined entity 'Delta'.'
/// <summary>
/// & Δ Δ
/// </summary>
public void DocumentedMethod()
{
}
What are the supported character entities for XML comments?
Solution
It's not a matter of comments, it's XML itself. XML only inherently knows about &
, <
, >
, '
and "
as well as the numeric entities. Anything else has to be declared explicitly.
See section 4.6 of the spec for further information.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow