Generating documentation from code with Team Build

Brian Keller replied to an internal email thread discussing generating documentation from code as part of a build.  If you are looking to do the same, these links should be helpful.  Here’s what Brian wrote.

I just wanted to point out that there are several MSBuild targets available for Sandcastle which should make it pretty straightforward to integrate with Team Build. I was actually at one of my customer’s offices yesterday and they were showing me that they had integrated Sandcastle with their build process and it looked quite good. I haven’t tried using these targets yet so I can’t tell you which one is best, but between the three of them you should find something which works for your customer:

tags: , , , , ,

Comments (5)

  1. Molto interessante: Brian Keller replied to an internal email thread discussing generating documentation

  2. Brian Harry on Daylight Savings Time Changes Coming and Our First Orcas perf results at load. Scott…

  3. andlju says:

    Hi, I’m the author of the CodePlex-project you mention.

    I’ve been thinking about this for quite some time now but just haven’t gotten around to looking at it yet. If there is enough interest I’d be happy to have a look at it!

    Vote on the issue here:


    Anders Ljusberg

  4. Tim Dallmann says:

    I currently have doc generation running as part of my nightly build.  I looked at all the MSBuild scripts people had created, but none seemed simple enough to implement and maintain (especially since I’m a consultant at a client, and I won’t be around forever!)

    The solution I came up with works really well however.  It’s based around the Sandcastle Help File Builder tool at  The GUI is used on the client against the helper’s configuration file, which is housed in the VS.Net solution, so developers can always maintain how docs are produced.  

    To generate the docs from the build, all I do is add the following targets:

    <Target Name="PackageBinaries">

    <!– Build source code docs –>

    <Exec Command="&quot;C:Program FilesEWSoftwareSandcastle Help File BuilderSandcastleBuilderConsole.exe&quot; &quot;$(SolutionRoot)srcMyProjectDocConfig.shfb&quot;" />


    <Target Name="AfterDropBuild">

    <!– delete old source code docs –>

    <CreateItem Include="\DocServerCode DocumentationProjectName***.*">

     <Output TaskParameter="Include" ItemName="DocDeployFiles" />


    <Delete Files="@(DocDeployFiles)" />

    <!– copy new source code docs –>

    <CreateItem Include="$(SolutionRoot)srcHelp***.*" Exclude="$(SolutionRoot)srcHelpWorking***.*">

     <Output TaskParameter="Include" ItemName="NewDocFiles" />


    <Copy SourceFiles="@(NewDocFiles)"

    DestinationFolder="\DocServerCode DocumentationProjectName%(NewDocFiles.RecursiveDir)" />


    This creates the docs based on the config maintained in the solution, and then copies them to a doc server, where I can access them through our team project portal.