Creating proper MSDN style documentation for your C# projects using SandCastle

In this article, I will walk you through series of steps to create a proper MSDN style documentation for your C#.NET projects using Visual Studio and SandCastle tool. In this way you will make sure you create a proper documentation for your .NET projects out of reflection information and XML documentation comments in your source code!

This is an easy three step process for you to quickly generate MSDN style CHM help file for your .NET projects. In this way, we will make sure to create proper documentation as well.

Step 1: Document your code properly

Make sure to put proper xml comments across all your .NET namespaces, classes, declarations, methods and so on.

To comment your code, just simply type three forward slashes "///", rest will be automatically populated by Visual studio itself. In this way, you just put across comments to all your modules.

XML comments

Step 2: Enable XML documentation property in the Output section of your Project Build properties.

XML documentation

Step 3: Generate a proper documentation out of reflection information and XML documentation comments in your source code.

Sandcastle comes in handy in this step.

Let's see what you need to create these CHM files:

•Download and Install Sand Castle via the MSI - Refer link below

•Download and Install the Sand Castle Help File Builder (SHFB) MSI by Eric Woodruff

• Create new project and add documentation sources (csproj or dll)to SHFB project
• Add references (csproj or dll)if any
• Set the help file format and other SHFB options


• Click on Build project under Documentation tab and please wait for the process to complete!


Hope this helps!

Thank you,


No responses found. Be the first to comment...

  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name: