Home > .NET Domain Model, Developing Using CodeFluent Entities > CodeFluent Entities: Generating a CHM documentation from your Business Object Model

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:

image

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:

/// <summary>
///     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:

image

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:

image

 

Carl Anderson

  1. Gilles
    February 29, 2012 at 4:16 pm

    Hello,

    about this part “Then in your model, add the Documentation sub-producer to your Business Object Model Producer”.

    Can you put xml codefluent code to add in xml please?
    I generate classes from .bat file, not from visual studio.

    Regards,
    Gilles

  2. Carl
    March 1, 2012 at 3:47 pm

    Hi Gilles,

    You’ll find an example on the producer’s documentation page: http://www.softfluent.com/documentation/webframe.html?Producers_DocumentationProducer.html

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s