You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
The XML doc section should move to language reference #23540
This section is more of a reference section than a programming guide section. So, it should move to the correct location.
As part of the move:
The overview section should be updated to include a typical workflow. It should also be more opinionated about its use.
The overview section may be one or two articles (Note that some articles are just link pointers, and the "recommended list" includes almost all tags. As such, it's not that helpful.:
Typical /// usage and recommended tags
Typical processing of the source, and the resulting XML file
The reference could be updated along one of two organizations:
Tags based on type (class, member, namespace, etc)
Alphabetical tags, and where they can be applied.
Tags based on scenarios:
Tags that describe a type, or member
Tags to include code
Tags for references
Tags for inheriting docs
I think that last organization is the most useful.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
ID: 306c4f25-192e-0980-c663-d829f38ef7c4
Version Independent ID: 8918a37b-cbfa-33f1-21e2-6bf5ea3ccb54
From reading all the issues referenced in the preceding comment, the following themes emerge:
Completing the reference tags: Visual Studio intellisense has support for a number of XML / HTML tags in XML comments. The introduction to the reference should list those tags validated by the compiler, those supported by intellisense, and point out that other tags are ignored, but legal.
General organization: There's a jumble of reference, recommended tags, how to create the XML file, how to process it. It's difficult for readers to address their scenarios quickly.
Examples based on language elements: The examples are tied to the XML tag, not the language elements were those tags would be used.
Nuances on parsing: < and > are valid XML, HTML, and C# (for generics). You can add CDATA sections to embed markdown in tags. These are all causes of annoyance for developers writing about their libraries. This theme could include attributes on tags, and XPath expressions for elements like inheritdoc.
Overall, these issues express a need for more and better examples showing how to add XML comments to libraries. I think the new organization should be:
Overview: How to turn on XML file generation. What tags the compiler validates, and what tags are validated by Visual Studio intellisense. Finally, links to tools that generate docs from the XML (docfx, SandCastle, Doxygen).
Recommended tags: This page details which tags are recommended, which is largely driven by what tags are displayed in intellisense, and what tags are most common. This will largely map to the recommended tags from the C# spec appendix.
Examples: Examples should show how to write XML doc comments for:
a class or struct, and a positional record
a class that inherits docs from a base
a class that inherits some docs from a base or interface
generic methods
generic classes
It's important for the examples to show different attributes and elements for links and cross-references, inheriting doc comments, and including external doc files. The examples also must highlight rules for where any of the child tags can and can't be used.
I think each of the examples should be its own article, however that's something I'll decide based on how long the article is. Each of the examples should include at least one member of each type that could be documented (constructor, method, constant, property, event). In the case of inheriting from an interface, and explicit interface implementation should be included
Activity
[-]The XML doc section should move to reference[/-][+]The XML doc section should move to language reference[/+]BillWagner commentedon May 19, 2021
This area has a large number of issues that should be addressed as part of the edits to move the content:
<example><inheritdoc><list><para><see><seealso>BillWagner commentedon May 20, 2021
From reading all the issues referenced in the preceding comment, the following themes emerge:
<and>are valid XML, HTML, and C# (for generics). You can add CDATA sections to embed markdown in tags. These are all causes of annoyance for developers writing about their libraries. This theme could include attributes on tags, and XPath expressions for elements likeinheritdoc.Overall, these issues express a need for more and better examples showing how to add XML comments to libraries. I think the new organization should be:
It's important for the examples to show different attributes and elements for links and cross-references, inheriting doc comments, and including external doc files. The examples also must highlight rules for where any of the child tags can and can't be used.
I think each of the examples should be its own article, however that's something I'll decide based on how long the article is. Each of the examples should include at least one member of each type that could be documented (constructor, method, constant, property, event). In the case of inheriting from an interface, and explicit interface implementation should be included
gewarren commentedon May 25, 2021
Can you also update the link right under this heading? https://review.docs.microsoft.com/en-us/help/contribute-ref/contribute-ref-how-to-write-.net-docs?branch=master#xml-doc-tags
BillWagner commentedon Jul 19, 2021
Fixed by #24705