469,571 Members | 1,650 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,571 developers. It's quick & easy.

Strong naming 3rd party assemblies / IL modifications.

Recently I had to do some really nasty work (I consider any IL work
nasty) to get a set of (not strong named) 3rd party assemblies to
compile with our solution (which is strong named).

DISCLAIMER:
We've notified the 3rd party and a strong named version will be
provided in the next release, but in the mean time for our internal
development and testing to continue we've had to do some hacking.
I do not recommend this technique with regards to production systems.
Get your provider to strong name their assemblies or choose another
provider.

The basic idea is something that has floated around on the newgroups
from time to time. The ildasm/ilasm trick. Essentially disassembling
the original assembly to IL, and then assemble it back to assembly with
a strong name key (in this case, our own one).

There is a further trick that I wanted to mention.

The scenario is as follows:

If the 3rd party assemblies are:

Assembly A,
Assembly B.

A references B

And in our solution we use both

Assembly A, B.

The IL generated in the original Assembly A will show something like
this in relation to the reference to B:

..assembly extern B
{
.ver 1:0:0:0
}

You need to modify the IL and insert your own public key here before
re-assembling "A" again.

..assembly extern B
{
.publickeytoken = (B7 7A 5C 56 19 34 E0 89 )
// .z\V.4..
.ver 1:0:0:0
}

(this example key is the mscorlib key - use your own public key that
you used to sign B)

This 'fix' is necessary because if we don't modify the reference here,
when we re-assemble "A", the reference information won't be updated,
then when we build our solution which references both A and B, it would
be fine with B, but with A it will error saying:

Assembly generation failed -- Referenced assembly 'B' does not have a
strong name

I saw a few posts here and there that related to this problem, but had
no solutions. Hope this helps someone (eventually/somewhere).

jliu
johnliu.net

May 24 '06 #1
0 959

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Ted | last post: by
10 posts views Thread by Tony Jones | last post: by
1 post views Thread by Jason | last post: by
1 post views Thread by Jimski | last post: by
8 posts views Thread by Jason | last post: by
7 posts views Thread by Bruce Wood | last post: by
6 posts views Thread by raylopez99 | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.