0

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

davidst95
  • 29
  • 6
  • 1
    possible duplicate of [Calling .NET methods from VB6 via COM visible DLL](http://stackoverflow.com/questions/233284/calling-net-methods-from-vb6-via-com-visible-dll) – Mgetz Jan 22 '14 at 01:24
  • @Mgetz Thanks for the reply. I tried that a few hours ago without luck. Do you any reason why it would work if I compile it Visual Studio but not work if I just run MSBUILD? Thanks. – davidst95 Jan 22 '14 at 03:10
  • Does it work if you wait to add the reference to your VB6 project until after you run your msbuild script? – Holistic Developer Jan 23 '14 at 03:00
  • Wouldn't it be easier just to build the DLLs from within the IDE? Most people are happy just to do that. – CJ7 Jan 23 '14 at 11:09

0 Answers0