Retrieving the COM class factory for component with CLSID

2011-04-28


We have a C# application which built in Windows XP using Visual Studio 2010, when we install this application to a 64-bit Windows 7 PC, we got the following error message in a popup windows:

Retreving the COM class factory for component with CLSID {0E59F1D5-1FBE-11D0-8FF2-00A0D10038BC} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).

The reason is because our project is using a 3rd party dll file or a COM component which ONLY support 32-bit operation system, but our project set the target platform to AnyCPU, like following (right click the project name and you will see the window):

**The solution is easy, just change platform target to 'x86' and rebuild the application again:

Because, your 64-bit Windows 7 allow 32 application to run.

good luck !

**