How to write xml comments in c#

My prefered way to write XML comments in C# is to write the first sentence on the first row like this:

/// <summary>This method does nothing.
/// <summary/>
public void Foo()
{
//NOP.
}

because when one folds the code (ctrl-m-o) one can see the first row like this:

/// This method does nothing. …
public void Foo() …

This is not an issue in vbnet.

To create a document out of this use Sandcastle which takes over after nDoc which is discontinued.

More comments on commenting are found here and here.

Tags: , ,

Leave a Reply