Generate .NET XML Documentation With NDoc

On SitePoint we can find an article about NDoc. As you may know, documentation in C# and VB.NET is done using XML in comments, like this:


/// This method does this and this

public void SomeMethod() {
   // ...

The VB.NET and C# compilers can extract these XML elements fromt he sourcefiles, but you're then still left with an XML file. NDoc is a tool to turn those documentation XML files into another format, such as a windows help file.

Systems documentation is one of those tasks that often suffers during the completion of a project. It's frequently pushed to the end of the development cycle, if it appears at all, in order to minimize redundant work.

However, with XML Documentation support in C# and VB.NET, and the development of NDoc, there is absolutely no reason we cannot document our systems in a much better fashion than we might have in the past. The work no longer lies in generating the documentation files; just in the documenting process itself.

My aim here is to show you how to install NDoc, and to run through a demonstration of how to use it. This article will not teach you how to document your code. Rather, it explains how to get your documentation into a useable form anyone can use.