This project has moved and is read-only. For the latest updates, please go here.

Custom build component - where to put config files.

Topics: User Forum
Apr 3, 2014 at 11:53 PM
Edited Apr 3, 2014 at 11:55 PM
Hi, I had an older build component project for 1.8 (I think) and have recent updated.

So I created a new build component from the template project and moved the code but I get
  BuildAssembler (v2014.1.26.0)
  Copyright ¸ 2006-2014, Microsoft Corporation, All Rights Reserved.
  Portions Copyright ¸ 2006-2014, Eric Woodruff, All Rights Reserved.
  Loading configuration...
BuildAssembler : error :  [C:\pathto\HtmlHelp\Working\BuildReferenceTopics.proj]
BuildAssembler : error : BuildAssemblerCore: The component 'HTMLInject_SandcastleBuildComponent_2014' was not found in any of the component assemblies [C:\pathto\HtmlHelp\Working\BuildReferenceTopics.proj]
BuildAssembler : error :  [C:\pathto\HtmlHelp\Working\BuildReferenceTopics.proj]
BuildAssembler : error : BuildAssemblerCore: An unexpected error occurred while attempting to create the build component 'HTMLInject_SandcastleBuildComponent_2014'. The error message is: see log for details

I put the build component DLL in

C:\ProgramData\ewsoftware\Sandcastle Help File Builder\Components and Plug-Ins

and I put HTMLInject2014.components in there too. I created HTMLInject2014.components based on the documentation (which doesn't seem to say where to put the file or what to call it)
<component id="HTMLInject_SandcastleBuildComponent_2014">
    <index name="reflection" value="/reflection/apis/api" key="@id" cache="15">
        <data base="{@SHFBFolder}Data\Reflection" recurse="true" files="*.xml" duplicateWarning="false" />
        <data files="reflection.xml" />
    <copy name="reflection" source="*" target="/document/reference" />
(I don't actually understand what this is describing, so I also tried porting my old config file)
 <component id="HTMLInject_SandcastleBuildComponent_2014"
     Inserts robots meta



   <insert placement="before"
     id="Post-transform Component" />

   <!-- <insertConceptual /> Not used for this one -->

   <configureMethod name="ConfigureComponent" />

     <output includeNamespaces="false"
       folder="{@OutputFolder}" />

The build component is just a simple tool to insert a robots nofollow meta tag in the HTML files that are built for website builds.

The good news is that the component does appear under Project Properties->Available build components. It just can't find it at build time.

Apr 4, 2014 at 4:14 PM
The components are all MEF based now and are discovered automatically without needing a ".components" file anymore. Regarding the build error, it would appear I forgot to include the components folder as a search location for BuildAssembler. I'll fix that for the next release. The work around for now would be to specify the path to the component using the project's Component Path property which is passed to BuildAssembler.

Marked as answer by shipwreckman on 4/8/2014 at 8:54 PM