locked
How to resolve runtime error: Retrieving the COM class factory for component with CLSID [CLSID] failed due to the following error: 80040154 Class not registered RRS feed

  • Question

  • I'm currently working on an old VS 2010 project recompiled to run on 64 bit machine. Its a windows service deployed via .msi installer. The windows service starts fine but when hitting the code that calls an 32 bit dll (interop.schur.dll) it crashes. The logs shows the error below:

    Retrieving the COM class factory for component with CLSID {1EB14A4A-3035-4D53-895D-06A60B9E115C} failed due to the following error: 80040154 Class not registered

    part of the deployment process is to call regsvr32 schur.dll.

    Kindly help please. Thanks.

    Friday, June 5, 2020 12:11 PM

All replies

  • A common cause of this error is a mismatch between the bitness of the COM client and the dll that hosts the COM server which the client is attempting to instantiate as well as whether the COM server has been registered in the 64 bit view of the registry or in the 32 bit view.

    Since you mention regsvr32 I assume that the in-process COM server is written in unmanaged code.

    If your windows service runs as a 64 bit process then an in-process COM server (dll) must also be 64 bit and registered in the 64 bit view of the registry.  Similarly, if the windows service is a 32 bit process then the in-process server must be 32 bit and registered in the 32 bit view of the registry.


    • Edited by RLWA32 Friday, June 5, 2020 12:33 PM
    • Proposed as answer by CoolDadTx Friday, June 5, 2020 1:11 PM
    Friday, June 5, 2020 12:31 PM
  • A 64-bit process cannot load a 32-bit DLL (and vice versa). Your options are limited.

    1. Recompile your x64 service as x86 and then the 32-bit DLL can be loaded.

    2. Get a 64-bit version of the COM DLL (if available).

    3. Determine if the COM object supports out of process (via an EXE) and then use the out of process COM object instead (if available).

    4. Create a standalone x86 process that exposes a callable API such as REST or WFC. Have the standalone process call the COM object in process. Modify your service to call the standalone process via the API you created.


    Michael Taylor http://www.michaeltaylorp3.net

    Friday, June 5, 2020 1:13 PM
  • Its a bit of a hack but the COM server registration could be edited so that the COM object could be instantiated in an out-of-process server by using the system's DllSurrogate.
    Friday, June 5, 2020 1:34 PM