[This is preliminary documentation and is subject to change.]
Sandcastle is not a single executable program but is actually a set of command-line programs and XSL transformations that are executed in a specific sequence to produce a set of files that can be used to create a help file. It is extremely flexible and offers many configurable features and the build process can be changed depending upon the desired output format and presentation style.
As the tools are command-line based, they can be used in various ways such as in batch files, MSBuild projects, and PowerShell scripts. One downside to its command-line based nature and the flexibility it offers with its various configuration files and presentation styles is a steep learning curve. Using the tools in their native form can be a daunting process so a good front end that hides the various details can greatly simplify the process of using them.
An example GUI and some command line scripts are provided with the Sandcastle tools but they provide limited functionality and do not expose enough of the configuration options to make them useful beyond a few simple examples. It is highly recommended that you use an open source front end such as the Sandcastle Help File Builder that provides both a standalone GUI as well as Visual Studio integration. It provides the usual project management options and also many more features that can be used to produce better looking help files and to author conceptual help topics. It also hides the complexity of the Sandcastle tools and lets you focus on the task of authoring the help content.
Sandcastle produces two types of help topic, each using a different build process. The results can be combined into a single help file.
Conceptual Content - This topic is an example of conceptual content. It is written using Microsoft Assistance Markup Language (MAML) and is used to create topics for general conceptual information, walkthroughs, how-tos, etc. For more information about MAML and how to use it, see the Sandcastle MAML Guide that is available for installation along with the Sandcastle tools.
API Reference Content - Reference content is generated by using reflection to generate information about one or more managed assemblies, the types it contains, and their members and combining that information with the related XML comments extracted from the source code. This produces topics with a format similar to those you see on MSDN. For more information about XML comments and how to use them, see the Sandcastle XML Comments Guide that is available for installation along with the Sandcastle tools.
It is important to note that Sandcastle itself does not generate the end result, a compiled help file such as a Help 1 (CHM), MS Help 2 (HxS), or an MS Help Viewer (MSHC) file. Instead, it relies on third-party tools such as the Help 1 compiler in the HTML Help Workshop, the Help 2 compiler in the Visual Studio SDK, or the third-party front ends to compress the content into an MS Help Viewer archive. The HTML output by Sandcastle is ready to use for website output but it lacks a front end to display the table of content in any meaningful way and does not provide for searching or a keyword index. Third-party tools such as the Sandcastle Help File Builder can fill these gaps for you.