Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using unsigned DLLs in project that is signed

I have a 3rd party DLL that I need to use in my application. My project is signed with an SNK so therefore I cannot use these unsigned DLLs without signing them.

I tried to use ildasm.exe as explained here but I get error messages when attempting to sign the DLL as the DLL contains unmanaged code. The error message I get is "the resulting PE file is unusable" (the DLL uses P/Invoke calls).

Any ideas what I can do here?

like image 878
Madeleine Avatar asked Dec 29 '22 06:12

Madeleine


2 Answers

The simplest approach is to rebuild the DLL with a key. You haven't told us anything about the 3rd party DLL... if it's a commercial library, I'd expect the company involved to be happy to give you a signed binary. If it's an open source library, you can do that yourself.

If you have no way of getting hold of a "normal" signed binary, perhaps you could give more details about the situation?

like image 81
Jon Skeet Avatar answered Jan 15 '23 14:01

Jon Skeet


If you can't get a signed version of the third-party assembly and need this to get working, a way out would be to load the dll dynamically at run-time.

like image 31
Dirk Vollmar Avatar answered Jan 15 '23 12:01

Dirk Vollmar