Solved

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

Posted on 2004-09-08
10
858 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
Comment Utility
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
Comment Utility
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
Comment Utility
Is it a regestered COM dll?
0
 
LVL 5

Expert Comment

by:thenrich
Comment Utility
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
Comment Utility
I don't see the class in the registry...
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 

Author Comment

by:kerenkalif
Comment Utility
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
Comment Utility
will your application work with just the first one regesterd?
0
 

Author Comment

by:kerenkalif
Comment Utility
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
Comment Utility
You can try re-registering it.
at the Start > run command prompt
regsvr32 C:\dllPathHere.dll
0
 

Author Comment

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

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
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.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

762 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

7 Experts available now in Live!

Get 1:1 Help Now