This post is a very simple example of how to create strong named assemblies and use in a solution. Each project uses the same strong named key. One key is uesd for the whole solution.
Step 1:
Create the snk Key
Open the Developer Command prompt as an administrator and enter sn -k C:/yourKeyPairName.snk
Step 2:
Add your key to the solution base directory and link it in each project
Note: Add As Link and not Add!, Add copies the key.
Step 3:
Use the snk in the project
Open the properties of each project, and in the signing tab, sign the project with your key.
Now all projects are strong named. The same key is used for all projects. The assemblies can be use in the GAC or are harder to tamper with.
You can also sign assemblies, if you don’t have the source code using the Ildasm.exe tool. You should only do this if you don’t have the source code. You should not use this approach if you have the source code as this borders on a dirty hack…
If you need to sign 3rd Party assemblies in you project, maybe the 3rd party assemblies shouldn’t be used…
Links:
http://msdn.microsoft.com/en-us/library/6f05ezxy(v=vs.110).aspx
http://en.wikipedia.org/wiki/Common_Intermediate_Language#Generation
http://buffered.io/posts/net-fu-signing-an-unsigned-assembly-without-delay-signing/
http://msdn.microsoft.com/en-us/library/f7dy01k1(VS.80).aspx
http://blog.codingoutloud.com/2010/03/13/three-ways-to-tell-whether-an-assembly-dl-is-strong-named/