Why am I getting 'Assembly '*.dll' must be strong signed in order to be marked as a prerequisite.'?

后端 未结 27 624
隐瞒了意图╮
隐瞒了意图╮ 2021-01-29 20:28

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 th

27条回答
  •  囚心锁ツ
    2021-01-29 21:13

    If you tried all the other answers in this question and you:

    • Have multiple projects in your solution
    • Have a project (Project A) that references another project (Project B), whose project references a NuGet package.
    • In Project A, you used Intellisense/ReSharper to bring in the reference to the NuGet package referenced in Project B (this can happen when a method in Project B returns a type provided by the NuGet package and that method is used in Project A)
    • updated the NuGet package via NuGet Package Manager (or CLI).

    ...you may have separate versions of the NuGet packages DLL in your projects' References, as the reference created by Intellisense/ReSharper will be a "normal" reference, and not a NuGet reference as expected, so the NuGet update process won't find or update it!

    To fix this, remove the reference in Project A, then use NuGet to install it, and make sure the NuGet packages in all projects are the same version. (as explain in this answer)


    Life Pro Tip:

    This issue can come up whenever ReSharper/Intellisense suggests to add a reference to your project. It can be much more deeply convoluted than the example above, with multiple interweaving projects and dependencies making it hard to track down. If the reference being suggested by ReSharper/Intellisense is actually from a NuGet package, use NuGet to install it.

提交回复
热议问题