Skip Navigation LinksHome > Generate documentation from XML comments in Visual Studio .net tutorial
Skip Navigation Links

 

 An easy way to generate documentation for classes, methods, interfaces,… from XML comments using visual studio .net is:

1. Type 3 slashes “///” in the line proceeding the method and visual studio will directly generate the most important XML Comments tags for you.

2. These are the summary, parameters list, and return value. You may add extra tags as remarks, example, code,...etc.

Code comment example  

3. Before you build your project right click on its name in the solution explorer and choose “properties”, then click on “Build” tab.

Choose properties from solution explorer in visual studio

4. Check on the XML Documentation File checkbox to tell Visual Studio to generate an XML documentation file.

check xml documentation file checkbox

5. Add this style sheet file to the output directory.

6. Open the XML documentation file and add the following line after the first list to tell the XML fileto look for and use the XSL style sheet file:

XML line to refere to XSL file

7. Now if you open the XML documentation file with your web browser, it will show the documentation in a readable format:

XML documentation result

References:

http://www.codeproject.com/KB/XML/XMLDocStylesheet.aspx

 

 
Copyright © 2007-2008 FastApps Inc. All Rights Reserved.