C# COMMENTING C# VS.NET Commenting
Most of us will have experienced the dread of updating documentation at some point or other. C# and Visual Studio .NET (VS.NET) give us the ability to maintain code and documentation in the same file, which makes the whole process a lot easier. VS.NET does this by taking specially marked and structured comments from within the code and building them into an XML file. This XML file can then be used to generate human-readable documentation in a variety of forms including web pages, MSDN style documentation and Intellisense within the code window.
…
3. COMMENTING STYLES AND TAGS
Once configured you can start to use the special XML tags in your procedure “headers”. To get you started place the cursor on the line directly above a procedure’s definition. Once there press the “/” key three times, this will automatically insert a summary tag into your code. If the procedure had any arguments there should now be a param tag for each one.
…
4. MSDN STYLE DOCUMENTATION AND NDOC
We have taken the intellisense format as far as it will go but there is much more we can do with MSDN style documentation. There is a tool that comes with VS.NET that you will find at “Tools|Build Comment Web Pages.” which will take your C# XML comments from source files and generate linked html files. This comes straight out of the box so should not be totally disregarded but if you want to create easy-to-use, helpful, cross-referenced and attractive documentation then I can strongly recommend the free, open source tool NDoc http://ndoc.sourceforge.net. The screenshot below is taken from a compiled help file produced from NDoc and is an example of the quality it can produce.
…
Website: www.charteris.com | Filesize: 480kb
No of Page(s): 10
Click here to download C# COMMENTING C# VS.NET Commenting.
Related Tutorial
Tags: .NET, commenting, Visual Studio
Comments
Leave a Reply