Robust generation of XML documentation comments for C#

Writing comments is something you need to get used to; sooner or later you will understand it’s worth writing comments. Haven’t you find yourself in a sitation where you don’t understand what a couple of lines of YOUR OWN code do? I have…

XML documentation comments are also important, particularly for public members/methods. Even if your project doesn’t require generating full XML documentation of the code, using Intellisense can be much more effective if it summarizes the method you are trying to use. If you want to generate XML documentation for C# in the twinkling of an eye you MUST install Roland Weigelt’s GhostDoc plugin for Visual Studio. Let me cite the author:

GhostDoc is a free add-in for Visual Studio that automatically generates XML documentation comments for C#. Either by using existing documentation inherited from base classes or implemented interfaces, or by deducing comments from name and type of e.g. methods, properties or parameters.

Once the plugin is installed and you have restared Visual Studio, go inside a method and press Ctrl + Shift + D. The XML documentation for the method appears just like that; it contain the summary, description of parameters, and information what the method returns. The only thing you have to do is to give a method a descriptive name and eventually polish what’s been generated. BTW, it works too for attributes and classes.

GhostDoc really saves your time and makes you a better developer – yet you care about the XML documentation, which is something of a higher level of understanding than your perfect code icon smile Robust generation of XML documentation comments for C#

 Robust generation of XML documentation comments for C#

1 Response to “Robust generation of XML documentation comments for C#”

  • Hi,
    If you like GhostDoc, then you may be interested in my Visual Studio add-in, AtomineerUtils, which is very similar but much more powerful.

    e.g. It uses thousands of rules to produce a much higher quality of auto-generated documentation text. It supports VB, C#, C++/CLI, C++ and C. It generates meaningful docs for every type of code element, it auto-documents exceptions thrown in a method, the format and layout is entirely user-configurable, it can word-wrap your entry text and expand hundreds of common abbreviations, and updates method/property/indexer comments to match the implementations. It can also duplicate best-match documentation from parameters elsewhere in the same class as well as from interface and base-class docs.

    It costs a tiny amount ($10), but there’s a 30-day free trial if you want to give it a go.

Leave a Reply