Need Help configuring Code Block for Stand Alone Script

Topics: Developer Forum
Jul 22, 2008 at 3:57 PM
hi,

I have a standalone script to build chm file and I wanted to use Code Block to retrieve code examples into it. I used SHFB and it worked fine. But when I modified the sandcastle config file as per instructions and changed the {@SHFBFolder} to point to the folder where the standalone components are downloaded and {@ProjectFolder} to the folder where the source files exists, the code examples are not reflecting in the help file.

Changed reference to {@ProjectFolder} as (source code)
<basePath value="K:\Src.NET\Base\Code\510\510.700\" />

Changed reference to {@SHFBFolder} (folder containing the downloaded files)
<component id="Code Block Component"
type="SandcastleBuilder.Components.CodeBlockComponent"
assembly="C:\Program Files\Sandcastle\ProductionTools\SandcastleBuilder.Components.dll">

and the reference in the file to be build is

''' <summary>
''' Function to Rate and Save policy to database and reload from database after performing necessary server side validations
''' </summary>
''' <returns>Nothing</returns>
''' <example>
''' <code lang="vbnet" source="Diamond\UI\Core\Controls\LookupCriteria.vb" region="LookupService.GetLookupParameters" title= "Lookup Service Call Code Example">
''' </code>
''' <code lang="vbnet" source="Diamond\UI\Core\ModalDialogs\AdvancedSearchForm.vb" region="LookupService.LookupByCriteria" title= "Lookup Service Call Code Example">
''' </code>
''' </example>

Note: No errors were detected.
Coordinator
Jul 22, 2008 at 7:22 PM

Are you seeing anything in the help topics?  If the code block component isn't finding something it will throw an exception.  Are you sure the correct configuration file is being used?  Also, have you included the Post Transform component in your configuration file?  The two are a matched pair and without it, you won't see any colorized code in the help topic.  See the help file for details.

Eric

 

Jul 23, 2008 at 3:10 PM
The help file looks fine except that the section under Example is blank. I am not sure how to determine what config file is being used (I am under the assumption that it uses the one under C:\Program Files\Sandcastle\ProductionTools and that's why I copied over the downloaded standalone components into the folder hoping it gets picked up from there. I have the log file of the build but its too large to include here. I also have the Post Transform component with the Code Block component in the sandcastlebuilder.component xml.

Suresh
Coordinator
Jul 23, 2008 at 6:45 PM

When using the components in a standalone fashion with your own build scripts, you need to modify your copy of sandcastle.config that you pass as a parameter to BuildAssembler.  The component definitions need to go in there.  The SandcastleBuilder.Components.xml file won't come into play as that is only used by SHFB to merge the components at build time.  See the help file for demo configs and info on where to merge them in your sandcastle.config file.

Eric