Using a COM component in a IIS Hosted WCF Service – Class not registered

If you are hosting a WCF service which utilises a COM component and is hosted in IIS you might, like I did, get confused when the calling client returns an error from the service complaining that the COM class is not registered (when you know it is!)


Exception is: COMException – Retrieving the COM class factory for component with CLSID {093CB055-4B2E-4700-BAEB-7EE2DED9CB8B} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0×80040154 (REGDB_E_CLASSNOTREG)).

This was very strange as instantiating the service directly worked fine. StackOverflow to the rescue again. It appears that because my service was running in a 64bit app pool, the host process couldn’t locate the registration (There are separate portions of the registry used to store 32-bit and 64-bit applications)

The fix was simply to set the app pool to enable 32-bit support

image

Leave a Reply

Post Comment