How do I put code examples in .NET XML comments?

1.7k views Asked by At

What tags can I use for putting code examples in .NET /// XML comments?

2

There are 2 answers

0
Jason Evans On BEST ANSWER

Try using the <example> tag.

/// <example>
/// <code>
/// // create the class that does translations
/// GiveHelpTransforms ght = new GiveHelpTransforms();
/// // have it load our XML into the SourceXML property
/// ght.LoadXMLFromFile(
///  "E:\\Inetpub\\wwwroot\\GiveHelp\\GiveHelpDoc.xml");
/// </code>
/// </example>

I got the above example from here.

0
Christian C. Salvadó On

You can use the <example> and <code> tags.

Check the Recommended Tags for Documentation Comments.