Click to expand
Sandcastle XML Comments Guide

Using a NamespaceDoc Class

If your build tool supports it, namespace comments can also be specified and maintained in your source code by adding an empty NamespaceDoc class to each namespace. When comments for this class are found in the XML comments files they will be used as the namespace comments.

To keep the NamespaceDoc class from appearing in the help file, leave off the public keyword and mark it with a CompilerGenerated attribute. This will cause the class to be automatically ignored when reflection information is generated for the assembly. The following is an example:

namespace Company.Product.Widgets
{
    /// <summary> 
    /// These are the namespace comments for <c>Company.Product.Widgets</c>. 
    /// </summary>
    [System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    class NamespaceDoc
    {
    }
}
Namespace Company.Product.Widgets
    ''' <summary> 
    ''' These are the namespace comments for <c>Company.Product.Widgets</c>. 
    ''' </summary>
    <System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _
    Class NamespaceDoc
    End Class 
End Namespace
See Also

Reference

Other Resources