32
6
In C# documentation tags allow you to produce output similar to MSDN. What are a list of allowable tags for use inside the /// (triple slash) comment area above classes, methods, and properties?
closed as off-topic by Mogsdad, Machavity, TylerH, Wonko the Sane, DavidG Jan 8 at 22:00
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it." – Mogsdad, Machavity, TylerH, Wonko the Sane, DavidG
add a comment
6
Check out Great documentation on the various C# XML documentation tags. (Go to the bottom to see the tags)
- 7Alas, the domain has expired and this is a broken link. – Mike Post Mar 19 '10 at 0:41
- Well that stinks - Google cache still has it, but for how long, who knows? – David Mohundro Mar 19 '10 at 2:11
- 1I assume this is just like JavaDocs when you publish that to a webpage. More updated link here: msdn.microsoft.com/en-us/library/b2s063f7.aspx – puretppc Jan 27 '14 at 2:21
12
If you type this just above a method or class, intellisense should prompt you with a list of available tags:
/// <
- What do all of them mean in general ? Which order should you use to specify them ? What would be the appropriate use cases for each ? What is possible, but discouraged in modern development practice ? – Neolisk Sep 6 '16 at 19:12
10
Here's a list:
- summary
- param
- returns
- example
- code
- see
- seealso
- list
- value
- file
- copyright
Here's an example:
<file>
<copyright>(c) Extreme Designers Inc. 2008.</copyright>
<datecreated>2008-09-15</datecreated>
<summary>
Here's my summary
</summary>
<remarks>
<para>The <see cref="TextReader"/> can be used in the following ways:</para>
<list type="number">
<item>first item</item>
<item>second item</item>
</list>
</remarks>
<example>
<code>
System.Console.WriteLine("Hello, World");
</code>
</example>
<param name="aParam">My first param</param>
<returns>an object that represents a summary</returns>
</file>
- 6
- 1What if I have a url I need to point to for more info? Where do I put that? – Shawn Mclean Aug 19 '12 at 22:22
- @KevinDriedger - I suggest you edit the list and remove the
authortag. For a moment there I was glad to see it there and then I was disappointed after reading Nap's voted comment and checking it myself with the link supplied by David Mohundro – yair Jan 11 at 23:06 - @KevinDriedger yes, thank you! Now it's more accurate. I don't want to push it (and I'd edit your answer myself if it weren't too big an intervention), but if it had contained a link to the MSDN recommended doc tags page and also mention here all of the tags that are there (like
permissionsthat's missing here and unlikecopyrightthat doesn't exist there) - that would be huge improve IMHO. – yair Jan 14 at 20:53
3
MSDN article from 2002 detailing all the tags and when to use them:
1
Look inside the docs for Sandcastle. This is the new documentation standard for .NET.