这是一个经典的问题,它有numerous解决方案described。但是,他们中没有一个人似乎为我工作。程序集生成失败 - 引用程序集没有强名称。为什么没有其他的解决方案?
我在SharePoint解决方案中使用了Report.NET库。添加Reports.dll作为参考,并在错误消息中编译结果“程序集生成失败 - 引用的程序集”报告“没有强名称。”然而,我的项目在项目属性中有一个key.snk链接。所以我尝试拆卸,签署与此密钥文件重新组合的dll,为其他地方所描述:
C:\Users\Administrator\Documents\Visual Studio 2010\Projects\MyProj
\dll>ildasm Reports.dll /out:Reports.il
C:\Users\Administrator\Documents\Visual Studio 2010\Projects\MyProj
\dll>ilasm Reports.il /dll /resource=Reports.res /key=..\key.snk
<output removed for brevity>
Class 95
Class 96
Method Implementations (total): 1
Resolving local member refs: 0 -> 0 defs, 0 refs, 0 unresolved
Writing PE file
Signing file with strong name
Operation completed successfully
我结束了一个新的Reports.dll时间戳的到现在。然而,将此作为对我的项目和构建的引用,会提供与以前相同的错误消息。 “报告”参考的属性显示“强名称:假”。
为了不被有点麻烦气馁,我尝试使用强命名工具来重新签署大会:
C:\Users\Administrator\Documents\Visual Studio 2010\Projects\MyProj
\dll>sn -R Reports.dll ..\key.snk
Microsoft (R) .NET Framework Strong Name Utility Version 4.0.30319.1
Copyright (c) Microsoft Corporation. All rights reserved.
Assembly 'Reports.dll' successfully re-signed
跑跑SN工具失败,出现错误消息,这可能是值得一提的“Reports.dll不代表强命名的程序集”在运行时之前的反汇编/签名/重组过程。
但是,在反汇编/签名/重组后,在重新将其添加到Visual Studio时,仍然会收到原始错误消息。
的可能重复[集生成失败 - 引用程序集“Interop.Office”不具有强名称](HTTP://计算器.com/questions/6845537/assembly-generation-failed-referenced-assembly-interop-office-does-not-have) – JabberwockyDecompiler 2015-05-19 16:23:56