Strong Signed Assemblies

前端 未结 10 1182
青春惊慌失措
青春惊慌失措 2020-12-05 13:42

I have a project I made in Visual Basic 2008 Express. I converted it from someone else\'s C# project, but it works. It has several DLL dependencies. I went to publish my pro

相关标签:
10条回答
  • 2020-12-05 14:24

    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

    0 讨论(0)
  • 2020-12-05 14:25

    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.

    0 讨论(0)
  • 2020-12-05 14:25

    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

    0 讨论(0)
  • 2020-12-05 14:27

    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.

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