473,698 Members | 2,440 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1125

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
2274
by: Ted | last post by:
What are the negatives to strongly naming assemblies? Why wouldn't we want to strongly name all assemblies that we ship as part of our products? Thanks Ted
10
2685
by: Tony Jones | last post by:
Can anyone think of a reason why a 3rd party vendor writing .NET components would NOT strong name their assemblies? What harm does adding a strong-name to assembly present - I would think none whatsoever. Strong-naming the assembly should benefit the end user just in case he/she wants to reference the assembly in another strong-named assembly or add it to the GAC. If you were a third-party vendor, would you strong-name your...
1
1457
by: Jason | last post by:
I've been experiementing with Assembly.Load..CreateInstance and strong naming the assemblies. This has given me a few questions, 1. Does the version number matter? I've found that its the public key token that controls whether the assembly is the right one. Changing the version number did not have any affect.
1
1450
by: Jimski | last post by:
Hi all, I am creating an assembly that will access a database to return record details. I need to deploy it to a 3rd Party and they will then be able to use the assembly in their code to access the methods contained within the assembly. As this assembly will effectively access the database then I need to provide some security to stop unwanted access.
8
1541
by: Jason | last post by:
In my ASP.NET 1.1 solutions, I created several web projects and compiled them each into an assembly. The assembly names reflected the functionality of the feature (Membership.dll, Dues.dll, etc). This made it easy to update an area of the product and deploy that assembly (along with it's associated Business Layer assembly). In 2.0, I can use pure dynamic compilation (ick - source code on the server); fixed_names (ick - hundreds or...
3
1600
by: Mark Keogh | last post by:
Hi, Why is everything some confusng when MS are involved ;-) Anyway, I have my excel export routines working fine, now when I try to build them into my assembly, which has a strong name, I get the Unable to emit assembly: Referenced assembly 'Interop.VBIDE' does not have a strong name message and everything stops. Now I searched the NET and all I can find is
7
1694
by: Bruce Wood | last post by:
I still haven't gotten through the .NET Framework Security tome on my desk. Maybe the folks here can answer a burning question. I want to use strong naming at our organization as a security measure: we could then indicate that any assemblies we signed are fully trusted, and so deploy centrally rather than having to deploy on each server. However, we still want to deploy by copying each app to a separate deployment directory, rather...
1
2841
by: Tom | last post by:
My unsigned DLL works in my project that references it as long as I set Copy Local = true. Now I have signed the DLL with the sn.exe generated keys but have not yet moved the DLL into the GAC. Can I use a strong named DLL outside the GAC with Copy Local = false by providing a reference to the public key? If yes to above, please tell me how to reference the public key within
6
5676
by: raylopez99 | last post by:
Anybody use Strong Name Signing? I think this is used by default for Resource files, which is one reason perhaps I can't get my resource files to work (somehow the public key is messed up, perhaps since I've installed so many versions of Visual Studio) RL http://msdn.microsoft.com/en-us/library/h4fa028b.aspx Deployment in Visual Studio
0
8608
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9161
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8897
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7732
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6522
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5860
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4370
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2006
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.