Strong Signed Assemblies

无人久伴 提交于 2019-11-27 20:28:33

If you're publishing via ClickOnce, go to the publish page and click on "Application Files". From there you should see a list of your DLL's. Ensure that the ones that are giving you trouble have their Publish Status marked as "Include" rather than "Prerequisite".

What this error message means is that the current publishing settings are going to expect all of the assemblies in question to be present in the Global Assembly Cache on the target machine before installation can take place. Since all assemblies in the GAC must be strong signed, any assembly marked as a prerequisite that isn't strong signed will give you this error.

Agustin

The workaround is more simple than that:

  1. Go to your project.
  2. Right click and Select Properties.
  3. Go to the Security Tab.
  4. Uncheck Enable ClickOnce security Settings.

Unless you are deploying this application through ClickOnce, you don't need to StrongName your assemblies.

Strongly named assemblies are mainly assemblies which have are signed by a cryptographic key. This is fairly easy to do with Visual Studio and does not require re-ordering of your dependencies.

I'm using non-express Visual Studio so the steps may be slightly different for you.

  • Right click on the project and select properties
  • Click on the Signing tab
  • Check "Sign the assembly"
  • In the combo box select "<New...>"
  • Complete the wizard
  • Rebuild

Check this link out...it has instructions for signing your assembly with a strong name:

MSDN: Signing an Assembly with a Strong Name

To create a strong name just go to the SDK Command Prompt or Visual Studio 200X Command Prompt then type in the following

sn -k sgKey.snk

Refer this link for details

Then associate the strong name to your assembly by running the below command

al /out:MyAssembly.dll MyOldAssembly.dll /keyfile:sgKey.snk

Refer this link for details

This just worked for me after the above mentioned solutions failed:

Remove the reference to the assembly in error, then add it again.

I found my problem to be in the .csproj file

<Reference Include="OtherProjectNothingToDo">
  <HintPath>..\..\..\..\Pedidos\XBAP\Pedidos\Pedidos\bin\Release\Pedidos.exe</HintPath>
</Reference>

Then I removed it using notepad and it is okay now.

mono código

Using Adam Robinson's solution allowed me to publish, but I found that users could not install the project once it was published, as the end user system would complain of an inability to install, noting hard drive space. As this seemed highly unlikely to be the root cause, I looked further into it.

Apparently the basis for my problem was that one of my references was also referencing a .dll that my project used, but a different version. ClickOnce was not having this, and refused to copy the second version of the .dll to the user's system, citing the version already present. Fixing it so the .dll and the project referenced the same version of the other .dll removed the error and corrected the install problem.

helper

Check that the Target Framework is actually set to 3.5 or whatever framework you want to target. Sometimes it will error out when it's not set properly.

I just had this problem too. In my case the blabla.dll was referenced in my solution but blabla.dll was also used in another.dll which i had referenced in my project.

On checking the versions of both blabla.dll they were not the same. So i updated another.dll with the correct blabla.dll and then referenced the new another.dll in my solution. The error was gone.

In short: i was using 2 versions of blabla.dll

I hope this makes sense, if not let me know. :)

Check my blog for more detailed explanation: Blog article

Regards, Jacob Iedema

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!