Solved

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

Posted on 2004-09-08
10
859 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

920 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now