Search code examples
c#.netweb-servicesiis-7com

Can't call COM Component from Web Service with IIS 7


I have a third party COM component which is called form a web servcice. While this works on my development machine I get this exception on the production server:

Retrieving the COM class factory for component with CLSID {6B7271AE-39C7-4C9E-B75F-6EDFCDBD623D} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).

Server: Win 2008 R2 Enterprise, 64 Bit

IIS: Version 7.5.7600.16385

What I checked

The registry entry

HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{6B7271AE-39C7-4C9E-B75F-6EDFCDBD623D}

exists on the production server and points to the correct DLL (C:\Program Files (x86)...\xyz.DLL

(There are no other CLSID entries with this GUID in the registry)

Third Party's test program works correct on the production server

(So the COM DLL is working ok)

What I tried

A (C#/.Net) Console applicatipon can call the COM component correctly on the production server.

(So .Net interop and com registration are ok)

The web-service can call the COM component if run on my development machine.

(So the program logic is ok)

Ich bin mit meinem Latein am Ende

(german for: I be on my wit's end)


Solution

  • As mentioned here: web service with com and from Peter Hahndorf the answer is quite simple:

    The IIS Application Pool Setting Enable 32 Bit Applications must be true.

    (IIS->Application Pools->Set Application Pool Defaults)

    Then the web service can access the COM component.