我在Visual Studio 2005项目中添加了一个弱命名的程序集(它是强命名的)。我现在得到的错误:

"引用程序集'xxxxxxxx'没有强名称"

我需要签署这个第三方程序集吗?


当前回答

如果您的程序集也是无符号的,则可以使用无符号程序集。

其他回答

展开使用“没有强名称键”的项目的项目文件,寻找.snk文件(. strongnamekey)。

在Windows资源管理器中浏览这个文件(这样你就知道它在哪里了)。

回到Visual Studio中那个没有“强名称键”的项目,做

右键单击项目文件 选择属性 选择“签名选项卡”(在左侧) 单击“签署程序集”复选框 然后<Browse>到前面找到的.snk文件

这样应该可以了。这为我解决了一个问题,在同一个解决方案中,在另一个项目中使用一个表单。

我希望这能有所帮助。

I had this issue for an app that was strongly named then had to change it in order to reference a non-strongly named assembly, so I unchecked 'Sign the assembly' in the project properties Signing section but it still complained. I figured it had to be an artifact somewhere causing the problem since I did everything else correctly and it was just that. I found and removed the line: [assembly: AssemblyKeyFile("yourkeyfilename.snk")] from its assemblyInfo.cs file. Then no build complaints after that.

我已经编写了一个工具来自动强名称标记程序集,包括您没有源代码的程序集或已放弃的项目。它以一种简单的方式使用了答案中描述的许多技术,没有任何现有工具或过时说明的缺陷或缺陷。

.NET程序集强- name签名者

我希望这可以帮助任何需要签署第三方程序集的人,而不必经过重重困难才能到达那里。

如果您的程序集也是无符号的,则可以使用无符号程序集。

情境: 你有方案A B C D在方案X Y中

X中的A、B、C项目 项目A, C, D在Y

我需要在项目A中使用项目C,但后来我不用了。在bin Debug项目A中有C.dll。

如果我编译解决方案X,一切都很好(在这个解决方案中,我删除参考A -> c),但在解决方案Y中,我得到了这个问题。

解决方案是删除项目A中的C.dll bin Debug