Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Registering a .NET dll for use in VB6 application

Tags:

.net

com

vb6

regasm

I have a DLL I wrote in C# which I want to use in my VB6 application.

In VS2008 the project property "Register for COM interop" is checked, and when I compile the DLL and try to use it on my development machine - it runs ok.

I need to run it on a computer which does not have VS2008, so I tried to register this DLL like so:

C:\WINDOWS\system32>..\Microsoft.NET\Framework\v2.0.50727\regasm myDLL.dll /tlb: myDLL.tlb /codebase

but then when I try to run it I get this error:

Automation Error. The system cannot find the file specified.

Can anybody tell me what I'm doing wrong?

like image 790
La La La Avatar asked Jun 29 '11 14:06

La La La


People also ask

How do I register .NET COM DLL?

You can run a command-line tool called the Assembly Registration Tool (Regasm.exe) to register or unregister an assembly for use with COM. Regasm.exe adds information about the class to the system registry so COM clients can use the . NET Framework class transparently.

How do I use .NET DLL in VBA?

Using the Code In Visual Studio, create a new Class Library project. In the project Properties, click on the Application tab, click on the Assembly Information button, check the option Make assembly COM-Visible. In the Build tab, check the option Register for COM interop. Add a new class CSharpInteropService.

Can we use C# DLL in VB net?

You asked: "I created a c# dll project under Visual Studio 2010, with several public classes, and I would like to use its classes inside another dll project, but written in vb.net." YES you can do it. Just add to that DLL reference and that's it!

How do I register a DLL with Regasm EXE?

By dragging and dropping the dll onto 'regasm' you can register it. You can open two 'Window Explorer' windows. One will contain the dll you wish to register. The 2nd window will be the location of the 'regasm' application.


1 Answers

Just like you specified the full path to regasm.exe, you need to specify the full path to your .dll ;-)

like image 187
Dabblernl Avatar answered Sep 30 '22 14:09

Dabblernl