比较程序集名称会导致不匹配:PUBLIC KEY TOKEN

时间:2020-11-06 17:55:24

标签: c# dll nuget publickeytoken

我已经经历过this answer on S.O.,但是它似乎并不能解决我的问题-这不是一个复杂的多项目网络解决方案。它要小得多,并且不需要绑定重定向,因为没有多个项目争夺同一个DLL参考。

对于有问题的项目:我们拥有源代码,拥有Visual Studio Project文件,这里有问题的DLL是完全拥有的,并且是众所周知的。我们可以访问SVN中的代码历史记录。

简而言之,我想将一个一次性升级的DLL手动升级到另一个项目中。.我想将其转换为我们私有供稿上的NuGet。我已经做了一百次了。.没什么大不了的。

DLL是一个相当简单的.NET 4框架代码,没有其他依赖项

但是当我“化”项目然后在另一个项目中引用它时,无法在运行时成功“找到”该项目。当我们去调用其中包含的类时,我得到了这个错误:

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)

如果进入调试模式,Visual Studio将在错误智能提示的FusionLog属性中显示此内容:

=== 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.

我需要看什么才能找出问题所在?

0 个答案:

没有答案
相关问题