Duplicate "Assembly Include" causing error BE0043

Topics: Developer Forum
Jul 27, 2011 at 8:35 PM

Could someone help? I am getting lots of

SHFB: Warning BE0063: 'Q:\DSI\General\General\bin\Debug\DSI.IRIS.General.XML' matches a previously copied comments filename.  The duplicate will be copied to a unique name to preserve the comments it contains.'

When SHFB tries to Build the GenerateRefInfo.proj  (MSBuild.exe), it errors out with

  Unhandled Exception: System.ArgumentException: An item with the same key has already been added.
     at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
     at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
     at Microsoft.Ddue.Tools.ManagedReflectionWriter.VisitNamespaces(NamespaceList spaces)
     at Microsoft.Ddue.Tools.Reflection.ApiVisitor.VisitApis()
     at Microsoft.Ddue.Tools.MRefBuilder.Main(String[] args)
W:\IRIS8\IT\ApiDocs_Updtd\Working\GenerateRefInfo.proj(35,5): error MSB6006: "MRefBuilder.exe" exited with code -532462766.
    Last step completed in 00:00:17.4967

SHFB: Error BE0043: Unexpected error detected in last build step.  See output above for details.


When I look at the GenerateRefInfo.proj file I see many

    <Assembly Include="Q:\DSI\General\General\bin\Debug\DSI.IRIS.General.dll" />

If I manually erase the duplicate "Assembly Includes" and manually "MSBuild GenerateRefInfo.proj", it succeeds. I thought SHFB automatically excluded duplicate "Assembly Includes". Has this changed? 

Understand that my Documentation Sources tree holds Solutions (.sln) to numerous child projects within my web page. Each solution/child project outputs their own DLL and XML. AND every project has a reference to a common "General" project located at 'Q:\DSI\General\General. This project contains all my C# utilities and helper classes/functions. I presume this is why the duplication exists, but I need this common utility in my projects.

I also looked for a plugin that would clean out duplicate assemblies from the GenerateRefInfo.proj file, before continuing to the next SHFB phase, but could not find one.

Can someone provide some guidance?

Jul 27, 2011 at 10:16 PM

If the same assemblies are all in different folders, they will be considered unique as it looks at the whole path, not just the assembly name.  If you've included the utility project as a solution project member, then it may get added multiple times.  If it's just a reference project, you probably don't need to include it as a solution member in each solution.  Just add the project reference to the application's references and remove the utility project from the solution.  Another alternative is to add the .csproj/.vbproj files as documentation sources rather than the solution files so that you can eliminate the duplication without modifying your solution files.



Aug 1, 2011 at 8:55 PM

@EWoddruff, I did the .csproj solution you suggested and it worked great. No duplication issues and everything compiled. Thank you.

Aug 2, 2011 at 6:40 PM

I checked the code and see that I was missing the duplicate assembly filename check in the code that parses solution files so I've added it there too.