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


About Rob Sanders

IT Professional and TOGAF 9 certified architect with nearly two decades of industry experience, 18 years in commercial software development and 11 years in IT consulting. Check out the "About Rob" page for more information.

Leave a comment

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>