RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

Tip of the Day
Language: .NET
Expertise: Intermediate
Apr 15, 2010

Auto-generate Visual Studio Project Documentation with GhostDoc

Whenever you write classes and functions in Visual Studio, it is a good practice to write XML comments for documentation. For example, before a function starts, you can document which parameters the function expects, briefly describe them, and explain what the function does exactly. Creating such XML comments for an entire project is particularly useful because it allows others to generate comprehensive documentation for the project.

A few code-checking tools like StyleCop also expect developers to write the proper documentation during development. A useful alternative is a free tool called GhostDoc, which automates the process of writing code comments, and it integrates into Visual Studio 2005/2008/2010. The rest of this tip explains how to use GhostDoc to generate Visual Studio code documentation automatically.

After installing GhostDoc, open your Visual Studio.NET project and select the function name for which you want to generate the documentation (ProcessLogin in this example). Right click to generate the context menu, and select "Document this". The function documentation will be added automatically, as shown below:

/// <summary>
/// Processes the login.
/// </summary>
/// <param name="verificationKey">The verification key.</param>
/// <param name="objOutput">The obj output.</param>
public static void ProcessLogin(string verificationKey, ref LoginOutput objOutput)


You can generate documentation for classes, functions, etc. easily with this tool and then edit it as required. Using GhostDoc is much faster than writing the documentation from scratch. You can also use the shortcut key (default: Ctrl+Shift_D) instead of the context menu to generate the documentation.

Deepankar Sinha
Close Icon
Thanks for your registration, follow us on our social networks to keep up-to-date