Creating Sandcastle documentation when creating a Visual Studio project

I am using Builder Builder Sandcastle to output my C # XML-DOC file to website format. How can I do the samething from the command line to add this as a build event in Visual Studio when creating the actual project?

The ultimate goal is to create the contents of the website's help file when I create a Visual Studio project.

+8
c # visual-studio sandcastle xmldoc
source share
4 answers

As Scott Wiley pointed out, you need to specify this on the post build event command line in the Visual Studio project properties. However, I would suggest using Sandboxle Help File Builder (SHFB) rather than Sandcastle directly. This makes the command line call short and simple, as shown below, but note that you first need to configure the SHFB project using the SHFB GUI, which creates the msbuild-compatible assembly file with the suffix ".shfbproj":

     C: \ Windows \ Microsoft.NET \ Framework \ v4.0.30319 \ MSBuild.exe
         / p: Configuration = Release myProject.shfbproj

However, please note that I take the opposite approach from what you are doing: instead of using Visual Studio to interactively launch the assembly and supporting actions, I use ant (nant) to start the assembly of everything, including my Visual Studio Solutions and subsequent SHFB actions. So this is really a command line call that I am making to create documentation using Sandcastle:

<exec executable="${msbuild}" dir="${csharpdoc}" output="${csharpdoc.log}"> <arg value="/p:Configuration=Release"/> <arg value="myProject.shfbproj"/> </exec> 

My preference is that the entire assembly should be launched from the command line so that interactions are not required (for example, starting Visual Studio, etc.). This provides the flexibility to run either as a scheduled recurring task or on demand from the shell.

+9
source share

You can call SandCastle from the command line post build event in the Build Events section of the properties of your project. This should work well if you are not using any automatic build tool.

+1
source share

If you use MSBuild for your build tool, this is a tutorial I used some time ago.

There is also a codeplex script that you can see in use that might help you.

Hope this helps!

0
source share

It was easier for me to just add the * .shfbproj project to the solution. It builds fine (albeit a little slow) inside VS 2010.

0
source share

All Articles