[DUG] Delphi2005 and Packages using Strong Named Assemblies

Rohit Gupta rohit at cfl.co.nz
Thu Jun 30 14:24:41 NZST 2005


Havent used com stuff.

However early versions of D2005 had this problem with win32 
packages.  That is the compiler/ide would die an ignomious death 
when you tried to use a component from a package that itself used 
another package.

It got repaired (I am told) in update3.  Havent had time to take my 
project off the backburner to try again.

Date sent:      	Thu, 30 Jun 2005 12:17:13 +1200
From:           	<Nigel.McClelland at sungard.com>
To:             	<delphi at ns3.123.co.nz>
Subject:        	[DUG] Delphi2005 and Packages using Strong Named Assemblies
Send reply to:  	NZ Borland Developers Group - Delphi List <delphi at ns3.123.co.nz>
	<mailto:delphi-request at ns3.123.co.nz?subject=unsubscribe>
	<mailto:delphi-request at ns3.123.co.nz?subject=subscribe>


Hi 

I have just started investigating using Delphi2005 Update 3to 
rewrite our Delphi5 COM+ components.

I set out to rewrite a simple component that contains COM+ Event 
Classes.
In order to add a component to the catalogue it needs to be strong 
named, which I did.

I tested the component and it ran fine.

I then set out to rewrite another component that is used to publish 
these COM+ events.
At first I was unable to consume my 1st component as it was a 
library. The compiler told me to use packages instead so I rewrote 
it as a package

I then created my second component as a package(successfully 
consuming the 1st one)

Finally I set out to builda test application that publishes some 
events,however the application fails to bind to my second 
component.
It fails with an error Comparing the assembly name resulted in the 
mismatch: PUBLIC KEY TOKEN.

I have tried using early signed Public/Private key pairs, and Delayed 
signing with a Public Key, and nothing seems to work.

Using ildasm and fusion logs the key bound in to the assembly is 
corrupt.
I have seen some other postings on the net but am yet to find a 
solution, so I cant get much further at all.


I also have asecondary issueusing the DefaultNameSpace option.

If I have PackageA with unit1 containing Class1 and Unit2 
containing Class2 I end up with the following:

When DefaultNameSpacenot set
COM+ shows components 
Unit1.Class1 Unit2.Class2

Delphi compiles units
Unit1.dcuil
Unit2..dcuil



When DefaultNameSpaceset to PackageA
COM+ shows components 
PackageA.Class1 PackageA.Class2

Delphi compiles units
PackageA.Unit1.dcuil PackageA.Unit2.dcuil






I would like to use the option of setting the NameSapace to 
PackageA but am unable to build a consumer when I do
as the compiler looks to link in Unit1.dcuil instead of 
PackageA.Unit1.dcuil 

Any help on these 2 issues would be greatly appreciated.

Thanks
Nigel
Regards

Rohit

====================================================
==================
CFL - Computer Fanatics Ltd.  21 Barry's Point Road, AKL, New 
Zealand
PH    (649) 489-2280 
FX    (649) 489-2290
email rohit at cfl.co.nz  or  r.gupta at xtra.co.nz
====================================================
==================




More information about the Delphi mailing list