Rajesh kumar’s Blog

If you have knowledge, let others light their candles at it.

Quickly Add XML Comments to Your Visual Studio Projects

Posted by Rajesh Kumar on May 8, 2009

Visual Studio gives us the flexibility to document the code with various types for XML comments. Visual Studio also provides a short cut “///” to get the default comment tags which does not include any default description as shown below:

Comment tags without description

Comment tags without description

Though it is okay, the developer needs to type a lot to fill the tags with the appropriate comments.

Would it not be a good idea to automate this too 🙂 ? If you are also looking for this kind of feature, do not resist yourself to visit “GhostDoc” tool.

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.

You can download the GhostDoc for Visual Studio 2008 at:


Once you extract the downloaded zip file, make sure to close all instances of “Visual Studio” and then double click on “GhostDoc2.1.3.msi” and install it.

After the installation, when you opened the Visual Studio for the first time, a GhostDoc setup screen will popup as given below:

HotKey Setup

HotKey Setup

Choose your required “HotKey” and then click on “Assign” button, then follow the next two screens (Create and Finish buttons).

Now, create or open any .Net project and type an empty method with some parameters. For this example, I have created and empty WebSite. When opened the Default.aspx.cs file, we can find Page_Load event.

 INSIDE the method or ON method name, right click the menu and choose “Document this” option as shown below:

Pre Document
Pre Document
Once you click on the above mentioned option, you can see the XML comments as given below:
Post Document

Post Document

Now you can clearly observe the difference and time saving between normal xml comments and GhostDoc features.
Hope you love to use it :).

13 Responses to “Quickly Add XML Comments to Your Visual Studio Projects”

  1. Coder73 said

    The question of whether or not we ought to do research on something can be an ethical question. ,

  2. Miss76 said

    What ways can we connect people in the same area? ,

  3. I think the admin of this site is in fact working hard in favor of his web
    site, since here every data is quality based material.

  4. I think that everything said made a bunch of sense. But, what about this?
    what if you were to write a awesome headline? I ain’t saying your
    content is not good, but suppose you added a post title that grabbed
    people’s attention? I mean Quickly Add XML Comments to Your Visual Studio Projects
    Rajesh kumars Blog is a little boring.
    You ought to look at Yahoo’s home page and note how they create
    article titles to grab viewers to click. You might try adding a video or a pic or two to get people interested about everything’ve got to say.

    Just my opinion, it could make your posts a little livelier.

  5. Piece of writing writing is also a excitement, if you know afterward you can write or else it is complex to

  6. I really like your blog.. very nice colors & theme.
    Did you create this website yourself or did you hire someone to do it for you?
    Plz respond as I’m looking to design my own blog and would like to know where u got
    this from. thank you

  7. Do you have a spam problem on this site; I also am a blogger, and I was wondering your situation; we
    have developed some nice practices and we are looking to swap techniques with other folks, why not shoot me an e-mail if interested.

  8. Hi there, this weekend is fastidious for me, as this occasion i am reading this fantastic educational piece of writing here at my residence.

  9. I know this if off topic but I’m looking into starting my own blog and was curious what
    all is needed to get setup? I’m assuming having a blog like yours would cost a pretty penny?
    I’m not very web savvy so I’m not 100% positive. Any suggestions or advice would
    be greatly appreciated. Thank you

  10. Pretty! This was an extremely wonderful article.
    Thanks for supplying this info.

  11. This is my first time pay a visit at here and i am genuinely happy to read all at one place.

  12. Hey there! Would you mind if I share your blog with my facebook group?
    There’s a lot of folks that I think would really enjoy your content.
    Please let me know. Thank you

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: