Strong Naming an existing assembly
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:
- Go to Visual Studio Command Prompt
- Generate a Strong Name Key File
sn -k keyPair.snk - Obtain MSIL for the assembly
ildasm Assembly.dll /out:Assembly.il
- Rename the original assembly
ren Assembly.dll Assembly.dll.old
- 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:
Continue reading » · Written on: 09-06-08 · 1 Comment »

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.
January 31st, 2009 at 6:04 pm