Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / September 2005

Tip: Looking for answers? Try searching our database.

Can't access .NET class when running VB6 project in IDE

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Joseph Geretz - 12 Sep 2005 20:27 GMT
VB6 SP6, Visual Studio 2003

I've copied my .NET assembly (SRSNetBroker.DLL) into my project folder. I've
registered it for interop using RegAsm /tlb which generated a tlb file in
the local project folder.

If I compile my VB6 project to EXE, then I've got the VB6 Executable, the
.NET DLL and the TLB file all colocated in the same folder. In this sceanrio
the EXE program runs fine. However, if I run from the IDE, I get the
following error, when attempting to create an instance of the .NET class:

File or assembly name SRSNetBroker, or one of its dependencies, was not
found.

Bear in mind that this does work properly when running from compiled
executable. So how come this won't run in the IDE?

Another annoying thing I'm finding in the IDE, is that I don't get
Intellisense for the methods and parameters of the .NET class which I'm
trying to create. Although again, bear in mind that the method calls do
succeed when running from executable. This is all probably just two symptoms
of the same underlying problem. Why can't I get this .NET assembly
registered for use in the VB6 IDE?

Thanks very much for any help which you can provide.

- Joe Geretz -
Joseph Geretz - 13 Sep 2005 05:15 GMT
Now that I've redefined my class reference os Object

   Private m_Repository as Object

This is working in the IDE.

I guess Interop classes are exclusively late bound objects?

I hope this won't effect performance. I need to stay within 45 - 60
milliseconds for retrieving 100K file from the server.

- Joe Geretz -

> VB6 SP6, Visual Studio 2003
>
[quoted text clipped - 24 lines]
>
> - Joe Geretz -
Robert Jordan - 13 Sep 2005 11:47 GMT
Hi Joseph,

> I've copied my .NET assembly (SRSNetBroker.DLL) into my project folder. I've
> registered it for interop using RegAsm /tlb which generated a tlb file in
[quoted text clipped - 7 lines]
> File or assembly name SRSNetBroker, or one of its dependencies, was not
> found.

The IDE has another working folder, so your dll simply cannot be found.

You must register the .NET DLL with this command line:

RegAsm /tlb /codebase SRSNetBroker.DLL

/codebase will instruct RegAsm to store the path of the DLL
in the registry.

Rob

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.