CodeFluent Entities: Generating a CHM documentation from your Business Object Model
CodeFluent Entities provides a Documentation producer capable of generating all files and scripts required by Sandcastle to generate a Microsoft Compiled HTML Help (CHM) documentation out of your CodeFluent Entities generated .NET Business Object Model (BOM).
Step 1: Downloading Sandcastle
First, you need to download and install Sandcastle on your machine (http://sandcastle.codeplex.com/).
Step 2: Generate using CodeFluent Entities
Then in your model, add the Documentation sub-producer to your Business Object Model Producer:
As the Sandcastle Target Directory, set the directory in which you want the sub-producer to generate all the Sandcastle scripts.
If you generate over again, you’ll notice that all members of your BOM (classes, fields, properties, methods) now have remarks:
/// Loads this instance.
/// </summary><param name=”id”>The id.</param>
public static SoftFluent.Advertising.Customer Load(int id)
Step 3: Get the XML documentation file & assembly
To build the CHM documentation Sandcastle needs as an input:
- The XML documentation file,
- The actual .NET assembly.
The XML documentation file isn’t created by default, to do so, in your project properties, in the Build tab, you need to check it:
Build your project so you’ll get both the XML documentation file made out of the generated remarks, as well as the compiled assembly (.dll).
Step 4: Check everything is in order
Those files, the XML documentation and dll, are passed to Sandcastle production tools by the BuildDocumentation.cmd script.
So, before running the script, make sure the paths used in it are correct!
Secondly, the MrefBuilder.exe tool uses reflection to extract information, therefore you need to specify all dependencies used by your BOM so it can load your assembly.
Once the MrefBuilder line of the script runs fine, you’re ready to run the script!
Step 5: Generate your documentation!
Run the script, and as a result you’ll have a Microsoft Compiled HTML Help documentation in the Chm directory: