views:

166

answers:

3

A while back I asked the following question here on stackoverflow 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?

+4  A: 

One option might be to use ILMerge to sign the 3rd party assembly though that would be a bit of a pain to update if the 3rd party deployed updates to their assembly very regularly

Eoin Campbell
A: 

You could disassemble the 3rd-party library and recompile it, signing it yourself. Of course, you shouldn't do this if it violates any licenses or if you aren't aware of the license for the 3rd-party library (which I assume you do being as you're using it). That said, if you're in contact with the 3rd-party, ask them to give you a signed version.

Jeff Yates
+7  A: 

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!

Lloyd Cotten