spam: Warn: CopyFromIndexComponent: Entries for the key ...

Topics: User Forum
Oct 29, 2009 at 8:24 PM

Every time I build documentation I get hundreds of messages like this:

Warn: CopyFromIndexComponent: Entries for the key 'M:Microsoft.Build.Tasks.Hosting.IVbcHostObject.SetOptimize(System.Boolean)' occur in both 'C:\Program Files\Sandcastle\Data\Reflection\Microsoft.Build.Tasks.xml' and 'C:\Program Files\Sandcastle\Data\Reflection\Microsoft.CompactFramework.Build.Tasks.xml'. The last entry will be used.

Is there any way to fix these warnings?

Coordinator
Oct 30, 2009 at 3:03 PM

They're just warnings so there's nothing to fix.  It's just telling you that comments for a member were found in two different comments files.  This happens if you've got two classes of the same name with members with matching signatures.  They can't be suppressed but you can just ignore them.

Eric

 

Oct 30, 2009 at 11:48 PM

The warnings are from Microsoft clases.  Using SHFB to build the help documentation for a 10 line hello world program generates hundreds of these warnings.

Feb 28, 2011 at 6:35 PM

I have the same problem (or should I say "no problem"). I understand that this may be by design, but it makes the build process significantly slower. I did not time it, but it seems to me that it takes about 4 times longer to build the same project than it used to be (I built the project in the previous version right before I installed the new one, and I can guarantee that it now takes significantly longer). 

Coordinator
Feb 28, 2011 at 8:34 PM
Edited Feb 28, 2011 at 8:35 PM

The warning messages have nothing to do with the speed.  If you are building multiple help file formats, then you may see a speed decrease with the latest release of SHFB in the BuildAssembler step since it builds the output for each selected help file format concurrently, each going to its own output folder.  This can increase memory usage which may in turn reduce the speed.  This was a required change due to the addition of the MS Help Viewer output format.  I plan on addressing the issue in a future release.  If you are only building one help file format, then there really aren't any changes that would affect the overall build.  There are other issues that can affect build speed, most notably the connection required to the MSDN web service to resolve links to framework members.  You can mitigate that somewhat by adding the cached build components to the ComponentConfigurations project property.  The cached comments component will suppress the above noted warnings since it loads a cached version of the index.

Eric

 

Feb 28, 2011 at 8:43 PM

My project is rather simple: it builds a single (CHM) help file form a handful of files (six or so). And I have not made any changes to the project from the previous version, so logically one would expect it to take about the same time to build. You may be right: the build speed may have been caused by something else, it's just when it goes over the motions of printing the warnings for hundreds of comment duplicates (all Microsoft classes that are not related to the project classes) I get an impression that this causes additional delay. Anyway, not a big issue: as long as it builds without errors, I'm fine, although faster is (almost) always better. Thanks for your work.

Coordinator
Mar 1, 2011 at 7:18 PM
Edited Mar 1, 2011 at 7:19 PM

As it turns out, there is an issue with the way it looks for the framework comments files.  I enabled the component's recursion option for the file searches and didn't realize that the client profile files where in the same location in a subfolder where the full framework files are located.  As such, it is generating message for all duplicate framework members which is quite substantial.  I've fixed the issue and will upload a fix later today that fixes another unrelated problem.  In the meantime, you can work around the problem by adding the Cached Framework Comments Index Data component to the project's ComponentConfigurations property as noted above.  After the first build, it will use the cache for the comment files and you won't see the warnings anymore.  I use it in all of my projects and hadn't noticed the duplication issue.

I should add that even with the fix in place, there are still some duplicate ID warning messages but nowhere near as many and not enough to slow down the build.

Eric

Mar 1, 2011 at 7:33 PM

Great. Thanks a lot Eric.