Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Assemblies and when strong naming is not an option?

A while back I asked the following question here on Stack Overflow, Assembly Names and Versions.

Now I have come to realize I can't sign my assembly with a strong name as one of the 3rd party dependencies is not a strongly named assembly and therefore mine is not signable.

I have tried to simply change the assembly filename MyAssembly.dll to MyAssembly.v.1.1.dll but when I do this and reference the renamed assembly - it does not get copied like the rest of the references. There seems to be because there is a mismatch between the filename and the Identity attribute of the assembly.

I have project A and B which are dependencies of project C. Project A needs to reference MyAssembly.dll v.1.0 and Project B needs to reference MyAssembly.dll v.2.0 so both need to be able to be located in Project C's bin/Release folder.

What is there to do? How can I fix this?


1 Answers

Ideally, any self-respecting 3rd-party assembly developer would sign their assemblies. I would try the following:

  1. See if you can contact the 3rd-party assembly provider and request that they sign it for you.
  2. If the 3rd-party assembly provider is open source, download and compile the source yourself with a strong name key. (Consider contributing this back to the project).

Otherwise, (as long as the license allows for it):

  1. Try ildasm.exe and ilasm.exe like so:

    ildasm.exe /out:TheAssembly.il TheAssembly.dll

    ilasm.exe TheAssembly.il /key=MyKey.snk /dll /output=TheAssembly.dll

  2. Try ILMerge as mentioned by the others.

Otherwise, you may have to look for another option for functionality you have currently in the 3rd party assembly.

Best of luck!

like image 184
Lloyd Cotten Avatar answered Jan 22 '26 17:01

Lloyd Cotten



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!