开发者

C# xml documentation

What's the purpose of the .xml doc开发者_如何学Pythonumentation 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?


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


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!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜