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

后端 未结 27 632
隐瞒了意图╮
隐瞒了意图╮ 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:04

    Deleting the DLL (where the error is occurred) and re-building the solution fixed my problem. Thanks

    0 讨论(0)
  • 2021-01-29 21:06

    If your main project using some library projects and have reference to them, you can cause this problem if your project reference to a assembly dll file instead to library project when you change something in your library project (ex: rename a class).

    You can check all references to your main project by view in Object Browser window (menu View->Object Browser). A reference to a dll file always has a version number. Ex: TestLib [1.0.0.0]

    Solution: delete the current reference of your main project to the library project and add reference to that library project again.

    0 讨论(0)
  • 2021-01-29 21:07

    Adding my solution for this issue for anyone it might help.

    I had a ClickOnce solution throwing this error. The app referenced a common "Libs" folder and contained a project reference to a Foo.dll. While none of the projects in the solution referenced the static copy of the Foo.dll in the "Libs" folder, some of the references in that folder did (ie: my solution had refs to Libs\Bar.dll which referenced Foo.dll.) Since the CO app pulled all the dependencies from Libs as well as their dependencies, both copies were going into the project. This was generating the error above.

    I fixed the problem by moving my Libs\Foo.dll static version into a subfolder, Libs\Fix\Foo.dll. This change made the ClickOnce app use only the project version of the DLL and the error disappeared.

    0 讨论(0)
  • 2021-01-29 21:09

    This is caused when you change the version of the .dll that is referenced. You need to delete all items, or the .dll in the target build folder.

    0 讨论(0)
  • 2021-01-29 21:10

    I got the similar compiler error. Once I add the dependent project of the dll file to the solution, issue resolved.

    0 讨论(0)
  • 2021-01-29 21:11

    you need to sign the assembly with a key. Go in the project properties under the tab signing: enter image description here

    0 讨论(0)
提交回复
热议问题