我试图使用c# 4.0编译我的excel插件,并在Visual Studio中构建我的项目时开始遇到这个问题。重要的是要告诉你,我以前从来没有遇到过这个问题。什么会导致这种情况发生?


当前回答

删除DLL(错误发生的地方)并重新构建解决方案解决了我的问题。谢谢

其他回答

I recently hit this problem. In my case, I have NuGet packages on different assemblies. What I had was different versions of the same NuGet packages associated with my own assemblies. My solution was to use the NuGet package manager upon the Solution, as opposed to the individual projects. This enables a "consolidation" option, where you can upgrade your NuGet packages across as many projects as you want - so they all reference the same version of the assembly. When I did the consolidations, the build failure disappeared.

我去发布应用程序文件,发现dll抛出错误,将其从“包括(自动)”更改为“包括”。我现在可以发表了。

我也遇到了一些问题,我所要做的就是删除导致错误的.dll(可以在参考中找到),并重新添加它。

效果非常好。

我有这个解决方案与6个项目。 我的一个项目是将命名程序集引用为文件引用。其他人都指向了项目参考。

在这种情况下,我通常会得到不同的错误。

我的解决方案是在引用命名程序集的任何地方删除它,然后再将它添加回来。 一旦我完成了这个项目,这个问题就消失了。 在此之前,我尝试清理解决方案,并确保没有任何项目被签名。

希望它能帮助到某人…

尝试update-package -重装-ignoredependencies