I’ve got this error when i tried to deploy my service with .NET wrapper for VB6 component :
System.Runtime.InteropServices.COMException (0x80040154): Retrieving the COM class factory for component with CLSID {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} failed due to the following error: 80040154
.

The workaround of this problem are:

  • Go to regedit and check for this entry {D8749532-0D3D-43B6-973C-C1D62BB6B3C7} ,(replace this with your clsid key) which is under “\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID”, If it is not exist then it almost certainly that you haven’t registered your VB6 component it self
  • Now you need to go to your project folder and find a reference folder and then copy the DLL that you created before (there will be several DLL under that folder, I believe you need to pick DLL with the largest size) and copy it to the same folder with your .NET DLL on production server
  • Register that DLL using “regsvr32 filename” (e.g regsvr32 APLCryptoCore.dll) and then restart your service and then it should be working