?
Solved

VB6 call a .NET 3.5 dll

Posted on 2014-01-21
1
Medium Priority
?
1,501 Views
Last Modified: 2014-01-24
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
Comment
Question by:davidst98
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 5

Accepted Solution

by:
advfinance earned 2000 total points
ID: 39799538
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Article by: Leon
Software Metering within our group of companies has always been an afterthought until auditing of software and licensing became a pain point. Orchestrator and SCCM metering gave us the answer and it was an exciting process.
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.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

650 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