Solved

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

Posted on 2004-09-08
10
861 Views
Last Modified: 2008-02-01
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
Comment
Question by:kerenkalif
  • 5
  • 5
10 Comments
 
LVL 5

Accepted Solution

by:
thenrich earned 500 total points
ID: 12005470
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
 

Author Comment

by:kerenkalif
ID: 12005639
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
 
LVL 5

Expert Comment

by:thenrich
ID: 12005663
Is it a regestered COM dll?
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 5

Expert Comment

by:thenrich
ID: 12005684
If it's regestered look in the registry under HKEY_CLASSES_ROOT for the name and try the CreateObject on that name.
0
 

Author Comment

by:kerenkalif
ID: 12006222
I don't see the class in the registry...
0
 

Author Comment

by:kerenkalif
ID: 12006716
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
 
LVL 5

Expert Comment

by:thenrich
ID: 12006756
will your application work with just the first one regesterd?
0
 

Author Comment

by:kerenkalif
ID: 12006894
partly ,beacuse I need the other one as well...
how come the first one is not registered? can I do something about it?
0
 
LVL 5

Expert Comment

by:thenrich
ID: 12009179
You can try re-registering it.
at the Start > run command prompt
regsvr32 C:\dllPathHere.dll
0
 

Author Comment

by:kerenkalif
ID: 12013435
Many-many thanks for the answers and for the patience all along :-)))
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question