我有一个C#程序集,由C#应用程序引用.
由于我们的编码标准,有一个规则,调试DLL后缀为"d"(例如ProjectA.dll变为ProjectAd.dll).当我将重命名的DLL的引用添加到应用程序时,它会成功构建,但会FileNotFoundException在执行时抛出.
抛出的错误如下:
System.IO.FileLoadException: Could not load file or assembly 'ProjectA, Version=1.0.0.0, Culture=neutral, PublicKeyToken=49df7f988e86ed92' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
File name: 'ProjectA, Version=1.0.0.0, Culture=neutral, PublicKeyToken=49df7f988e86ed92'
程序集管理器也会发出警告并报错:
WRN: Comparing the assembly name resulted in the mismatch: PUBLIC KEY TOKEN
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.
从错误消息,它看起来像是在寻找没有d后缀的程序集.
顺便说一句,有一个由同一个应用程序引用的C++/CLI程序集.它d附加到DLL,但在VS2005中查看引用的属性表明安全标识已d正确附加.C#的文献并没有 …
c# ×1