How to Give an Assembly a Strong Name

To Strongly name an assembly you need to associate it with a public and private key. This can be either done by the developer when they compile the assembly (signing) or by at a later stage for instance by the QA department (delayed signing).

Public and private keys can be associated with code signing certificates, generated using sn.exe, or they can be generated from within Visual Studio.

Open the project properties for the assembly you want to sign and check ‘sign the assembly’ on the signing tab. To create a key file, select New from the drop down and follow the directions or Browse for an existing key file. If you create a key file it is worth moving it from the bin directory as you should be using it across multiple projects.

Once compiled you will have a signed assembly with a strong name.

Leave a Reply