Microsoft .NET - Tips and Tricks



Monday, January 28, 2008
Signing a 3rd party DLL
Why?

A few days ago I got a question that I was asked a few months ago and the same thing I needed a few times already by myself. The thing is that we often get a 3rd party DLL/assembly that is not signed and we have to use it from a signed DLL/assembly.
In most cases it would be a copyright issue to disassemble someone’s work/dll and modify it but in some cases you are either allowed to do that or you will get a signed version from the owner sooner or later but you need to start with development immediately and not to lose valuable time.

If you are allowed to do that then this is the solution you may use.

How?

The idea I found some time ago goes like this:
1. Use disassembler to generate the MSIL code
2. Use the assembler to reassemble the MSIL code into the binary assembly and sign it at the same time

Here is an example of how to do that:
1. ildasm /tokens /out=TempUnsignedAssembly.il A3rdPartyAssembly.dll
2. ilasm /dll /key=TemporaryKey.snk TempUnsignedAssembly.il /out=A3rdPartySignedAssembly.dll

Here are a few comments on commands above:
- A3rdPartyAssembly.dll should be replaced with the name of 3rd party DLL/assembly you want to sign
- TemporaryKey.snk is strong name key that you will need to generate and use for 3rd party DLL/assembly signing
- A3rdPartySignedAssembly.dll should be replaced with the name of DLL that you want to get as result of these operations (it will be a signed version of original 3rd party DLL).

NB: don’t forget to check the license agreement and to ask for a signed DLL from the 3rd party before you deliver your product or before you go to production with it.

posted by Popovic Sasa
 

2 Comments:

At 3/12/2008, Anonymous Josephine said...
Hi!

I am using a third party DLL (Component Art) for Ajax. We have bought a license for this as well and used it extensively across all our non sharepoint projects. It’s just for this one (driven by MOSS 2007) that it keeps giving me an evaluation error regarding the license key when I have placed the license file in the bin and registered the DLL in the web.config. Is there something more to do? Do I need to place the license key in the GAC inorder for the DLL access it?

Would be great if you could assist. Thanks!

Josephine   At 3/12/2008, Blogger Popovic Sasa said...
Hi Josephine,

This article was not really about license files for 3rd party DLLs.

I didn't work with "Component Art" so I suggest you contant their customer support for question regarding the licence in MOSS environment.

Btw, I don't think you can put a license file into GAC.

Regards,
Sasa  
Post a Comment

Links to this post:

<\$BlogItemBacklinkCreate\$>


+ Blog Home
 

Links

Get the Levi9 RSS Feed
Levi9 Global Sourcing

Previous Posts

Custom paging SPGridView control
Serving files from server
Configuring CruiseControl .Net to work with multip...
Sharing cookies between sub-domains

Archives

February 2007
March 2007
April 2007
January 2008
February 2008

Powered by Blogger
Levi9 Global Sourcing | Jan van Goyenkade 8 | 1075 HP Amsterdam | The Netherlands | +31(0)72 58 210 55 | info@levi9.com
Copyright © Levi 9 | Design by A36