4

I am trying to run my Windows Application (winForm) on a PC (OS Win7, 64 Bit) but it showing me this error or exception:

Retrieving the COM class factory for components with CLSID {00853A19-BD51-419B-9269-2DABE57EB61f} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).

I google and found that I should need to Build for x86 (Althought current window is 64 bit). I did this but getting the same error. After that now I trying to install zkeeper dependency but getting this error:

enter image description here

The Module D:\TheSDK\zkemkeeper.dll" may not compatible with the version of windows that you are running. Check if the moduel is compatible with an x86 or x64 version of regsvr32.exe

Here is batch file (Dependency SDK installer) :

cd /d %~dp0
if /i "%PROCESSOR_IDENTIFIER:~0,3%"=="X86" (
    echo system is x86
    copy .\*.dll %windir%\system32\
    regsvr32 %windir%\system32\zkemkeeper.dll

    ) else (
        echo system is x64
        copy .\*.dll %windir%\SysWOW64\
        regsvr32 %windir%\SysWOW64\zkemkeeper.dll

    )

Update: Even I try to run and install manually both regsvr of system32 and 64 and still getting same error.

Muhammad Faizan Khan
  • 10,013
  • 18
  • 97
  • 186
  • According to https://blogs.msdn.microsoft.com/deva/2010/09/27/error-message-on-64-bit-windows-when-you-try-run-regsvr32-exe/ you need to use the right version of regsvr32 – BugFinder Sep 30 '19 at 11:43
  • 2
    That .bat file is wrong, it must use c:\windows\syswow64\regsvr32.exe. Pretty scary btw, dumping so many files into the operating system directory is quite unhealthy. There is a nuget package for it, it might do less damage. – Hans Passant Sep 30 '19 at 12:07
  • @BugFinder I try to directly register but still the same error. Tried System32 and Syswow64 regsvr but same issue. – Muhammad Faizan Khan Sep 30 '19 at 12:14
  • @HansPassant i used C:\windows\System32>regsvr32 D:\TheSDK\zkemkeeper.dll but still getting the same error. – Muhammad Faizan Khan Sep 30 '19 at 12:15
  • @HansPassant yeah i have tried with C:\Windows\Syswow64\regsvr32 D:\TheSDK\Zkemkeeper.dll but still the same error message. – Muhammad Faizan Khan Sep 30 '19 at 13:00
  • Sometimes the registration fails because the DLL itself (or any of its dependencies) has missing or broken dependencies. If you are willing to dig deeper, [download](https://github.com/lucasg/Dependencies/releases) and run [Dependencies](https://github.com/lucasg/Dependencies) on zkemkeeper.dll and look for any red. – Megabit Oct 05 '19 at 02:48

2 Answers2

1

I don't know what was the problem but maybe it was related to .Net framework. After installing the developer pack of .Net Framework 4.5.2. I deleted my SDK and register all the dependency (DLL) again. Then, it worked.

Muhammad Faizan Khan
  • 10,013
  • 18
  • 97
  • 186
0

This error occurs because the com dll Zmkeeper.dll was not able to register. In some cases, it might need to be registered along with a typeLib file. Also, there could perhaps be some custom installer action performed if it goes through an installer. Seems like a demo version installation solved the problem. checkout this issue mentioned here