Strong naming an assembly without having the actual source code

Today I had a blocking issue, I was in the process of Strong naming my assemblies yet I was referencing a third party assembly that was not strongly named. This cause a compilation error :S what to do????

A colleague David Field sent me 2 command line snippets that do just the thing…

Basically the idea is to use ILDASM.exe (which comes with .net SDK) to convert the dll to il and then use ILASM to make that IL badk into a dll and sign it. (please note you need an SNK file, you can create one easily with the sn.exe or just use one from the other assemblies you are signing)

the magic of ILDASM and ILASM >>

ildasm myassembly.dll /out:myassembly.il

where myassembly is the name of the DLL

and then we convert that IL back in a dll and sign it with ILASM

ilasm myassembly.il /dll /key=MyStringNameFile.snk

Hope you find this useful I sure did

4 thoughts on “Strong naming an assembly without having the actual source code

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s