Want to Strong Name?

Strong naming. Net assemblies isn’t new.  Prepping dependency assemblies (specifically, those not in the Global Address Cache) is also non-trivial but necessary.

Here’s a quick way to apply strong naming to an existing (non-signed) assembly.

From a Visual Studio.NET command prompt, enter the following:

1.       To Generate a Strong Name Key (.snk):

sn -k keyPair.snk

2.       Obtain the MSIL (Intermediate language) for the target .Net assembly:

ildasm targetAssembly.dll /out:targetAssembly.il

3.       Rename/move the original assembly:

ren targetAssembly.dll targetAssembly.dll.orig

4.       Create a new assembly from the MSIL (Intermediate Language) output and a strong name key pair (.snk):

ilasm targetAssembly.il /dll /key=keyPair.snk

That should do It.

5. Verify the strong name:

sn -V targetAssembly.dll

Once you are satisfied with the new Dll, you can delete the .orig (backup) copy.

Use responsibly..
/R

Leave a comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.