How to add a strong name to an existing DLL

From a VS.NET command prompt, enter the following:

  1. Generate a KeyFile: "sn -k keyPair.snk"

  2. Get the MSIL for the assembly: "ildasm SomeAssembly.dll /out:SomeAssembly.il"

  3. Rename the original assembly, just in case: "ren SomeAssembly.dll SomeAssembly.dll.orig"

  4. Build a new assembly from the MSIL output and your KeyFile: "ilasm SomeAssembly.il /dll /key= keyPair.snk"

Last updated