为什么会出现'大会'的* .dll“一定要坚强签署才能被标记为prerequisite。”?标记、坚强、才能、大会

2023-09-07 11:53:31 作者:光头其实也是种帅i

我想要编译使用C#4.0我的Excel插件,并开始建立我在Visual Studio项目什么时候能得到这个问题。重要的是要告诉你,我以前没有过这样的问题。什么会导致这种情况发生?

I'm trying to compile my excel addin using C# 4.0, and started to get this problem when building my project in Visual Studio. It's important to tell you that I haven't had this problem before. What could cause this to happen?

推荐答案

我的猜测是,你不是在用强命名程序集。我有这个错误时,两个项目引用略有不同版本的同一总成和更依赖项目引用这些项目。在我的情况下,该决议是要删除该程序集名称的关键和版本信息中的.csproj文件(它没有反正无所谓),然后做一个干净的构建。

My guess is that you're not working with strongly named assemblies. I've had this error when two projects reference slightly different versions of the same assembly and a more dependent project references these projects. The resolution in my case was to remove the key and version information from the assembly name in the .csproj files (it didn't matter anyway), and then do a clean build.

在我的情况下,在不同的装配版本之间的变化是与解决方案指的是他们的部分兼容。如果这不是你的话,你可能需要做更多的工作来解决问题。

In my case, changes between the different assembly versions were compatible with the parts of the solution referring to them. If this is not the case with you, you might have to do some more work to resolve the issue.

使用的NuGet,很容易陷入这种情况下,如果:

With NuGet, it's easy to get into this situation if:

您在解决方案中安装一个包一个项目。 在该包的新版本部署到软件包源。 您将它安装在同一个解决方案的另一个项目。

这将导致两个项目的解决方案中的引用不同版本的该程序包的组件。如果他们中的一个引用另一个并且是的ClickOnce应用程序,你会看到这个问题。

This results in two projects in your solution referencing different versions of that package's assemblies. If one of them references the other and is a ClickOnce app, you'll see this problem.

有关我的答案是发出更新包[包名] 命令在的NuGet包管理器控制台和它所带来的一切到一个公平的竞争环境,在而此时问题就走开了。

For me the answer was to issue the update-package [package name] command at the Nuget Package Manager Console and it brought everything up to a level playing field, at which point the problem went away.