c# - How to add List type code example in XML comment? -
i have used below xml comment,
/// <example> /// example shows how use <see cref="samplecollection"/> property. /// <code> /// class testclass /// { /// list<string> collection = new list<string>(); /// collection.add("column1"); /// collection.add("column2"); /// this.samplecollection = collection; /// } /// </code> /// </example> public list<string> samplecollection { get; set; }
but has following warning error,
xml comment on 'samplecollection' has badly formed xml -- 'end tag 'code' not match start tag 'string'.'
because list definition has <string>
. considered xml tag.
is there way resolve this?
use cdata block embed raw text within xml:
<![cdata[ list<string> ... ]]>
Comments
Post a Comment