Reputation: 401
I am trying to add documentation to my C# code. But the following gives me a malformed xml error. I know that the error is because of 'List"Display"'. It's trying to find "/Display". But there won't be a "/Display" because it's a part of my code example. Can someone help me with this? Thank you.
/// <summary>
/// Retrieves a list of <c>Display</c>
/// </summary>
/// <example>
/// <code>
/// List<Display> templates = DisplayManager.GetDisplays();
/// </code>
/// </example>
Upvotes: 2
Views: 201
Reputation: 158289
It's quite common to write List{Display}
in XML documentation.
Upvotes: 2
Reputation: 5286
Try wrapping yout code content within CDATA
<![CDATA[List<Display> templates = DisplayManager.GetDisplays();]]>
All text in an XML document will be parsed by the parser.
But text inside a CDATA section will be ignored by the parser.
Upvotes: 1