• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1524
  • Last Modified:

VB6 call a .NET 3.5 dll

I'm trying to call a .NET 3.5 C# dll from a VB 6 GUI. I added the .NET 3.5 dll as a reference to the VB6 Project. The .NET dll is compiled with COM Interop enabled. If I compile the .NET dll in Visual Studio I have no problem with the VB6 GUI using the .NET dll. However when I put the .NET csproj in a buld script that compiles all my .NET dlls with MSBUILD.EXE I get a "Runtime error '429': Active X component can't create object" when the VB6 GUI tries to access it. I'm not sure what's the difference in compiling the .NET dll within Visual Studio 2010 and using MSBUILD. Is Visual Studio 2010 more forgiving? I tried to manually register it using regsvr32 and regasm but no luck Could anyone point me in the right direction? I'm on Windows 7. Thanks.

David
0
davidst98
Asked:
davidst98
1 Solution
 
advfinanceCommented:
For your VB6 application to be able to locate the .NET DLL it must either be installed into the Global Assembly Cache, placed into the VB6 application directory (either the IDE's directory or your application's directory - depending upon whether you are running your program from the VB6 IDE or from a compiled EXE) or the .NET DLL must have been registered for COM interop using the /codebase option of regasm. I believe if using the "register for COM interop" option in the C# project file it will register the assembly using the /codebase option.

--
Chris
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now