How can I document a namespace?

A namespace can be documented as any other code construct - directly in the source code. Just select any file that contains the namespace declaration and add an XML comment above the namespace/Namespace keyword. You can use VSdocman's Add XML comment option from the context menu or the comment editor.

C#:

/// <summary>This is my namespace.</summary>
namespace SampleClassLibrary
{
...
}

VB .NET:

''' <summary>This is my namespace.</summary>
Namespace SampleClassLibrary
...
End Namespace

Visual Studio will show a warning that an XML comment is not allowed on a namespace. You can whether ignore the warning or you can suppress it.

A single namespace can be used in multiple files, but you only document it in a one. It doesn't matter which one it is. If you add an XML comment for the same namespace on multiple places, VSdocman will show a warning during the compilation and a comment from a random place will be used.

In VB .NET, the root namespace has no source code representation. See how to document VB .NET root namespace.

 

Start generating your .NET documentation now!
DOWNLOAD
Free, fully functional trial
VSdocman Tip
Adding <see> and <seealso> links into your XML comments is easier with VSdocman's WYSIWYG comment editor.
Customers

Universities
Medical institutions
Government institutions
Large financial institutions
Thousands of SW companies

Deloitte & Touche
PricewaterhouseCoopers
Bloomberg
Wells Fargo
QBE

Caterpillar
Lear
DuPont
Pfizer

Boeing
Airbus
Rolls-Royce Naval Marine
Toyota Motorsport

Bose
Mitsubishi Electric
Johnson Controls
Bentley Systems

Intel
Hewlett Packard
Bosch (Australia)
Schneider Electric

Intergraph
Volvo Information Technology
SOPRA GROUP
Agilent Technologies
Tesco SW

Syncfusion
T-Systems
Verizon
Fraunhofer Heinrich-Hertz-Institut

vs launch partner logo

VS Mag award VS Mag award

A few years ago, we gave a test to several products to document our source code. We finally chose VSdocman mostly because it was easy to use, from within the development environment, making training of programmers useless. It provides flexible features which enables producing complete documentation for people using our products and also for internal use. When technical support is required (we needed this when switching to VS 2015), Peter answered our emails very quickly. After more than 3 years with VSdocman, we strongly recommend the product which is amazingly easier to use than SandCastle.

Pierrick Combreau, Product Manager, Quotalys Ltd