Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# xml documentation

Tags:

c#

xml

What's the purpose of the .xml documentation files shipped with the assemblies (.dll files).

I know, how to build a one (as here, for example), but what can they be used for?

Also, if this documentation can be integrated into the MS Visual Studio environment, how should that be done?

like image 538
Yippie-Ki-Yay Avatar asked Dec 05 '10 00:12

Yippie-Ki-Yay


2 Answers

If you put the XML file in the same folder as the DLL, Visual Studio will show descriptions in IntelliSense. (including parameter tooltips)

like image 110
SLaks Avatar answered Oct 27 '22 01:10

SLaks


Using the xml documentation with the recommended tags greatly improves the readability of code when they are used by external classes.

Also, you can generate a help document from the xml comments using tools like Sandcastle. This tool generates a chm file that is very similar to the documentation that you see on msdn for .NET classes.

As for the integration into Visual Studio environment, it is done automatically and happens as soon as you build you project. While using the documented class / method / property, the Intellisense feature shows the xml comments.

In addition, free Visual Studio tools like Ghost Doc (from SubMain) allow you to generate most of the tags simply by using key board shortcuts!

like image 35
Devendra D. Chavan Avatar answered Oct 27 '22 03:10

Devendra D. Chavan