1

I've already been through this answer on S.O. but it really doesn't seem to solve my issue - this is not a complex multi-project web solution.. it's much smaller and doesn't really need binding redirects as there aren't multiple projects vying for the same DLL reference.

For the project in question: we own the source code, we have the Visual Studio Project files, the DLLs in question here are wholly owned and wholly known.. we have access to the history of the code in SVN.

In short, I wanted to upgrade a DLL that we once-upon-a-time would drop into another project, manually.. I want to turn it into a NuGet on our private feed. I've done this a hundred times.. no big deal.

The DLL is a fairly simple .NET 4 framework code and has no other dependencies

But when I 'nugetize' the project and then reference it in another project, it cannot be 'found' successfully at run time. I get this error when we go to invoke the class contained within it:

Could not load file or assembly 'MyCorp.DataAccessLayer, Version=1.3.0.0, Culture=neutral, PublicKeyToken=e5ee1faf2523c727' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

If I go into debug mode, visual studio shows this in the FusionLog property of the error intellisense:

=== Pre-bind state information ===
LOG: DisplayName = MyCorp.DataAccessLayer, Version=1.3.0.0, Culture=neutral, PublicKeyToken=e5ee1faf2523c727
 (Fully-specified)
LOG: Appbase = file:///C:/MyCorpRepository/MyCorp.AttachmentManager/Trunk/MyCorp.AttachmentManager.Tests/bin/Debug
LOG: Initial PrivatePath = NULL
Calling assembly : MyCorp.DefaultAttachmentManager, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\MyCorpRepository\MyCorp.AttachmentManager\Trunk\MyCorp.AttachmentManager.Tests\bin\Debug\MyCorp.AttachmentManager.Tests.dll.config
LOG: Using host configuration file: 
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: MyCorp.DataAccessLayer, Version=1.3.0.0, Culture=neutral, PublicKeyToken=e5ee1faf2523c727
LOG: Attempting download of new URL file:///C:/MyCorpRepository/MyCorp.AttachmentManager/Trunk/MyCorp.AttachmentManager.Tests/bin/Debug/MyCorp.DataAccessLayer.DLL.
WRN: Comparing the assembly name resulted in the mismatch: PUBLIC KEY TOKEN
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.

What do I need to look at to pinpoint the problem?

4

0 回答 0