Search code examples
c#dependenciesassembly-signingilasmildasm

signing unsigned interdependent third party libraries


My project uses a set of unsigned third party libraries (compiled in .Net 2.0). I already know how to sign these libraries using ildasm and ilasm. However, the problem is that the thirdparty libraries are interdependent. As a result, after ilasm, when I compile my project, I get "missing reference" errors because lib1.dll is looking for the "PublicKeyToken=null" edition of lib2.dll.

I also tried compiling all the 3 ".il" files into a single library, I get errors for "multiple assembly declarations".

Any ideas how to get around this ?


Solution

  • I'd say that you should use Mono.Cecil that can sign an existing assembly, bu also add the signature of the reference of an assembly inside an assembly (what is called AssemblyReference).