Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Class not registered Error

Running an application from Visual Studio 2012 on 64-bit computers, displays the following error message:

Retrieving the COM class factory for component with CLSID {F2D4F4E5-EEA1-46FF-A83B-A270C92DAE4B} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))

I am using Inventor packandgo dll library in visualstudio.

Anyone know what is the error?

like image 277
Arun Avatar asked Aug 01 '13 05:08

Arun


People also ask

Why does my outlook say Class not registered?

For outlook issue, This Class not registered error may be encountered due to possible corruption or non-allocation of the Outlwvw. dll file or it may result due to damaged registry entries. 1. Press Windows Key + R combination, type put Regedt32.exe in Run dialog box and hit Enter to open the Registry Editor.

Why does my HP say Class not registered?

According to users, “Class not registered” error appears when they try to open a . jpg file on their computer, and this problem can be fixed by resetting default apps. To do that, follow these instructions: Open Settings > Apps > Default apps.


1 Answers

My problem and the solution

  1. I have a 32 bit third party dll which I have installed in 2008 R2 machine which is 64 bit.

  2. I have a wcf service created in .net 4.5 framework which calls the 32 bit third party dll for process. Now I have build property set to target 'any' cpu and deployed it to the 64 bit machine.

  3. When Ii tried to invoke the wcf service got error "80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG"

  4. Now Ii used ProcMon.exe to trace the com registry issue and identified that the process is looking for the registry entry at HKLM\CLSID and HKCR\CLSID where there is no entry.

  5. Came to know that Microsoft will not register the 32 bit com components to the paths HKLM\CLSID, HKCR\CLSID in 64 bit machine rather it places the entry in HKLM\Wow6432Node\CLSID and HKCR\Wow6432Node\CLSID paths.

  6. Now the conflict is 64 bit process trying to invoke 32 bit process in 64 bit machine which will look for the registry entry in HKLM\CLSID, HKCR\CLSID. The solution is we have to force the 64 bit process to look at the registry entry at HKLM\Wow6432Node\CLSID and HKCR\Wow6432Node\CLSID.

  7. This can be achieved by configuring the wcf service project properties to target to 'X86' machine instead of 'Any'.

  8. After deploying the 'X86' version to the 2008 R2 server got the issue "System.BadImageFormatException: Could not load file or assembly"

  9. Solution to this badimageformatexception is setting the 'Enable32bitApplications' to 'True' in IIS Apppool properties for the right apppool.

like image 69
Waheed Avatar answered Sep 19 '22 19:09

Waheed