Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 869
  • Last Modified:

Using DLL that is not strong-name-key in a DLL that must be strong-name-key

Hi,

I am writing a DLL in VB.NET. This DLL will be used in computers that have the .NET framework installed, therefore need to be strong-name-key (or not?).
In this DLL I need to use a DLL, that apperently is not strong-name-key: when I try to compile my dll with the reference to the other DLL I get the error:
Unable to emit assembly: Referenced assembly 'Interop.DSOBJECTSLib' does not have a strong name

How do I use the other dll in my dll, or how do I distribute my dll if it is not strong-name-key?
0
kerenkalif
Asked:
kerenkalif
  • 5
  • 5
1 Solution
 
thenrichCommented:
Maybe try unreferencing the dll and late bind to it. Get a pointer to it using GetObject() or CreateObject() and Dim your dll-pointer to the object as 'Object'. Kind'a a hack but it should work.

Is the other dll a .NET dll or a COM dll?
0
 
kerenkalifAuthor Commented:
Hi,

I don't know what type is the other dll, I got it as is...
Anyway, if I don't do any reference to the dll, when I try to do CreateObject, it doen't recognize it...

I tried to do:
Dim ds = CreateObject("dsobjects.DSOBJECTSLib")
Dim z_DsCommand As ds.DSCommand

But it doesn't recognize the command...

Can you please show me a code example? The dll name is dsobjects and I need to use an object named DSOBJECTSLib.


Thanks,
KerenK
0
 
thenrichCommented:
Is it a regestered COM dll?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
thenrichCommented:
If it's regestered look in the registry under HKEY_CLASSES_ROOT for the name and try the CreateObject on that name.
0
 
kerenkalifAuthor Commented:
I don't see the class in the registry...
0
 
kerenkalifAuthor Commented:
There are 2 class in the dll: DSCommand and DSoaifCtrl. The second one does appear in the registry and it does work as you suggested, but the first one doesn't appear in the registry...
0
 
thenrichCommented:
will your application work with just the first one regesterd?
0
 
kerenkalifAuthor Commented:
partly ,beacuse I need the other one as well...
how come the first one is not registered? can I do something about it?
0
 
thenrichCommented:
You can try re-registering it.
at the Start > run command prompt
regsvr32 C:\dllPathHere.dll
0
 
kerenkalifAuthor Commented:
Many-many thanks for the answers and for the patience all along :-)))
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 5
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now