views:

57

answers:

3

I'm trying to update a vb6 DLL and redeploy a .NET service, but I'm getting the following error:

System.Runtime.InteropServices.COMException (0x80040154): Retrieving the COM class factory for component with CLSID {D01BF589-BC04-4119-8168-AE6180BBD021} failed due to the following error: 80040154.

The steps I'm taking in deployment are as follows:

  1. Compile VB6 COM DLL
  2. Register the COM dll on the target machine
  3. Use tblimp to create an Interop DLL
  4. Add this Interop DLL to the .NET project
  5. Recompile the project and the installer
  6. Run the installer on the target machine (which previously did not have the service installed)

Any ideas?

A: 

You may be missing other dll's needed by your COM object at the target machine. 'listdlls' and 'procexp' from sysinternals might be of help to identify what is missing. Also .NET may be trying to force it to run as a 64bit app. Running corflags with the /32bit+ switch may help.

Otávio Décio
+1  A: 

The error code 0x80040154 translates as REGDB_E_CLASSNOTREG which means "Class not registered", so I'm guessing that your class was not registered. You should look in the registry under HKEY_LOCAL_MACHINE\CLSID and make sure that your registration didn't fail and that it actually points to your dll.

John Knoeller
A: 

You do have the VB runtime installed on the target machine and it's associated auxiliary supporting files? Did you run a regsrvr32 on the dll? Have you checked with TypeLib to see if it is in the registry on the target machine?

Hope this helps, Best regards, Tom.

tommieb75
I searched the registry and found the DLL registered twice under different locations. It turns out that the DLL registered under TypeLib was an old one. I unregistered both DLLs, then registered the correct one. It's working now. Thanks!
spiderdijon