Sandcastle MSBuild target

I've seen some recent blogs on Sandcastle, the new documentation tool for .NET assemblies. Joel challenged us to write something that would integrate documentation as a build step in a Team System build.

I took Mikael Söderström's original Sandcastle Helper batch file and converted it to a set of MSBuild targets. It took a few hours on a Saturday night (that I probably should have been doing something else with), and I think I've pretty much got it.

Now I notice that Mikael has enhanced his original helper into a Gui that supports multiple files and so on, which is all nice. I'm not going to do that with this MSBuild target (at least not now) but if you want to update my stuff, by all means do so.

In the SandcastleTarget.Zip file there are three files.

  1. Sandcastle.Target, which contains the bulk of the work.
  2. Sandcastle.config file used by the Sandcastle Build Assembler, which needs some tailoring for your project to include the correct .XML comment files. This is pretty much copied from Mikael's helper.
  3. A SandcastleTest.msbuild file which is a sample that shows how you should call the Documentation target in the Sandcastle.Target file for your project.

This isn't terribly pretty, nor is it extensively tested, I just wanted to get something out that might be useful. (There is a bit of a weirdness in the Exec task for the Html Help Compiler tool (HHC.exe) in that its return codes are 0 if an error occurs, or 1 if no error occurs, so I had to say IgnoreExitCode="true".)

Mike

No Comments