XML Documentation Comments
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer

XML Documentation Comments (C# Programming Guide)

In Visual C# you can create documentation for your code by including XML tags in special comment fields in your source code directly before the code block they refer to. For example:

/// <summary>
///  This class performs an important function.
/// </summary>
public class MyClass{}

When you compile with /doc the compiler will search for all XML tags in your source code and create an XML documentation file.


The XML doc comments are not metadata; they are not included in the compiled assembly and therefore they are not accessible through reflection.

In This Section

Related Sections

C# Language Specification

For more information, see the following sections in the C# Language Specification:

  • Appendix A Documentation Comments

See Also

© 2015 Microsoft