Skip to content


Strong Naming an existing assembly

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

Now this is one problem that we face when we use a 3rd party DLL, which is not-strongly named & we still want to dump it to GAC.

So, lets see the 5-step solution:

  1. Go to Visual Studio Command Prompt
  2. Generate a Strong Name Key File
    sn -k keyPair.snkĀ 
  3. Obtain MSIL for the assembly
    ildasm Assembly.dll /out:Assembly.ilĀ
    Ā 
  4. Rename the original assembly
    ren Assembly.dll Assembly.dll.oldĀ
    Ā 
  5. Create a new assembly from MSIL & Key File
    ilasm Assembly.il /dll /key= keyPair.snkĀ 
The new Assembly is a strong-named assembly.


Related Posts:

Posted in C#, Microsoft .NET, Winform.

Tagged with .


One Response

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  1. Eduardo Navarro says

    Changing a third party assembly might not be the best way to go. This is ok with hobby projects but not something you want to do with stuff you publish. Even if there is no human-readable evidence the digital signature in one way or the other implies certain ownership from you or your apps. This even for open source software could be a potential breach in the license. So beware. If you want to access weakly-named assemblies from a strong-name context you can always use reflection.



Some HTML is OK

or, reply to this post via trackback.