Sandcastle Help Compiler 2 support


After installing the August CPT of Sandcastle, you’ll need to update to the latest version of the MSBuild script.

I’ve just released a new version of the MSBuild-script for Sandcastle. There are two new features and one new (though optional) requirement.

First of all, the new requirement is the Visual Studio .NET Help Integration Kit 2003 which contains Microsoft Help Compiler 2.

The two new features of the script are:

  • Can now compile both CHM (Html Help 1.x) and HxS (Microsoft Help 2) files
  • Supports custom content files (things like header, footer and copyright text)

You can download the following files:

    Unzip the contents of this file to c:\Program Files\MSBuild\Sandcastle.
    This file contains a sample solution and a sample MSBuild script (called Documentation.proj).

Instructions are more or less the same as before:

  1. If you haven’t already done so, install the Sandcastle June CTP. The scripts rely on a completly unmodified installation, so don’t make any changes to it (especially not the sandcastle.config file).
  2. Unzip the contents of to your MSBuild folder (usually c:\Program Files\MSBuild)
  3. Unzip the contents of to wherever you like to keep your sample projects.
  4. Open up the SandcastleTest.sln solution file and build the project.
  5. Open a Visual Studio 2005 Command prompt, navigate to the SandcastleTest folder and run the one of the following commands:
    • MSBuild Documentation.proj
      To build a CHM file.
    • MSBuild Documentation.proj /t:DocumentationNew
      To build an HxS file.
    • MSBuild Documentation.proj /t:DocumentationAll
      To build both a CHM and an HxS file
  6. Cross your fingers, and when the process is finished, look for the Output\SandcastleTest.chm and/or the Output\SandcastleTest.HxS files!
  7. In order to actually view an HxS-file you’ll need to register it with MSHelp. Or, an easier way (just to see that it works) is to use the free H2Viewer-utility.

3 responses to “Sandcastle Help Compiler 2 support”

  1. Great script! If you want the appropriate name to appear in CHM title add Title=$(HelpName) at HHPFileContents section in Sandcastle.Files.includes.

    /Anders G


  2. Works great!

    Does anybody know how to register the HxS file using the h2reg ( utility?

    NDoc generated a INI file for that. Is this maybe an option for your MSBuild task?


  3. Wonderful. But I have these concerns. Can somebody post on how to achieve this. I’m kind of lost here.
    * Display the correct help title.( I do not see HHFileContents section in Sandcastle.files.includes)

    Display The search tab with search enabled.

    Any help would be appreciated


Leave a Reply

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

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

Facebook photo

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

Connecting to %s

About Me

Consultant, Solution Architect, Developer.

Do note that this blog is very, very old. Please consider that before you follow any of the advice in here!


%d bloggers like this: