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

SCHFB Build error that I can't seem to find a reason for.

Topics: Developer Forum, User Forum
Dec 3, 2009 at 3:31 PM

Hi All,

I'm trying to build an HTML Help file for a library I'm writting, and quite frankly hitting a brick wall.

The Build output gives me the following as soon as I hit the build button:


[Sandcastle Help File Builder Utilities, version]
Creating output and working folders...
Finding tools...
Found Sandcastle in 'C:\Program Files (x86)\Sandcastle\'
Found HTML 1.x help compiler in 'C:\Program Files (x86)\HTML Help Workshop\'
Validating and copying documentation source information
    Last step completed in 00:00:00.0000

SHFB: Error BE0065: BUILD FAILED: An item with the same key has already been added.

I understand what the error message is telling me, but it would be a great idea if it told me which key, or where, or how...  or just some detail that would help me track it down rather than just giving a generic output.


I've not added anything special to the project, I simply added my XML comments to the documentation sources, and my compiled library to the references, changed the Help Title, Copyright Text and Html Help Name and that's it.


I'm completely stumped as to what I've apparently duplicated.


Any ideas?


Dec 3, 2009 at 8:30 PM
Edited Dec 3, 2009 at 8:31 PM

The BE0065 error is a general failure, something unexpected that should (almost) never happen.  It can only tell you what's in the exception message since I wasn't expecting duplicate keys in that area so didn't add any specific checks for them.  Chances are that you've somehow got an assembly in the documentation sources that is a duplicate or a reference that is a duplicate.  You said you added your assembly to the references.  If you want it documented it should be a documentation source instead along with the XML comments file.  References are just used for additional information needed to resolve references to other assemblies but they aren't included in the resulting help file.

The best way to solve this would be to remove all documentation sources and all references.  Add your assembly and XML comments file as documentation sources and try the build.  If it fails complaining about a missing reference, add that assembly as a reference.  The simplest approach is to just add the Visual Studio solution or project file as a documentation source.  SHFB will figure out the assemblies and comments files to use for documentation and the reference assemblies for itself.



Dec 4, 2009 at 9:39 AM

Hi Eric,

Thanks for your response.

Indeed you hit the nail on the head.

For some reason, I'd set the xml file from the project as documentation source, then I'd added my compiled class library to the references rather than the document sources

Once I removed the assembly from reference, and added it to doc sources everything was fine.


Don't know what on earth possessed me to do that, must have been having a blond moment or something :-)


Thanks for your help....