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 project so I can install it on another machine and for each DLL, I get an error: "Assembly must be strong signed in order to be marked as a prerequisite." I've done some research, but am not finding a lot and what I have found I don't really understand. What does this error mean? What is the best way to resolve it? One other thing: it took me a LONG time to be able to get all my dll's to reference correctly, so I prefer that the solution has NOTHING to do with moving DLL's around because that will likely break the functionality in my main project.
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.
Check this link out...it has instructions for signing your assembly with a strong name:
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
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
what also helps:check that the Target Framework is actually set to 3.5 or whatever. Sometimes, it is not set.
This just worked for me after the above mentioned solutions failed:
Remove the reference to the assembly in error, then add it again.