Generating XML Comments with GhostDoc

by Edward 20 July 2010 08:26

GhostDoc is a free Visual Studio extension which I stumbled accross while looking for something to help me with commenting my code. GhostDoc automatically generates XML documentation comments for methods and properties based on their type, parameters, name, and other contextual information. It takes the 'pain' out of commenting each method word for word - saving you time doing what you do best - coding!

Most documentation created will be a waste of time for a developer, and usually when there is no time to waste a developer might find the documentation is slowing him down. For any decent documentation to be useful, a developer must know that when the documentation was initially generated it was both correct and complete, it has also been updated as the project scope changed, or amendments was made to the code. I ofter find code to out of sync with documentation, which leaves me with lots of 'catch up' to do, before I feel in control and productive.

You can set it up, so when you right click on a method the "Document This" option becomes available that allows you to generate summary comments for your method.

GhostDoc comments

Here is an example of summary comments I created using this tool.       

        /// <summary>
        /// Checks for SQL injection.
        /// </summary>
        /// <param name="userInput">The user input.</param>
        /// <returns></returns>
        public static string checkForSQLInjection(string userInput)
        {
        // code here
       }

It is also supported in the following versions of the Visual Studio IDEs:

  • Visual Studio 2010
  • Visual Studio 2008
  • Visual Studio 2005

Supported Languages:

  • VB.NET
  • C#

Download it from here:

http://visualstudiogallery.msdn.microsoft.com/en-us/46A20578-F0D5-4B1E-B55D-F001A6345748

Tags: , ,

ASP.NET | Development Resources | Other

Comments are closed

About DasCode.Net

I'm a ASP.NET web developer and code enthusiast. Blogging about everything .Net related.

Code... that's .net

Month List