I'm trying to reference a COM dll from my ASP.NET Web API site running on Windows Server 2008 R2 Standard Service Pack 1 64-bit using IIS 7.5.
I can register the COM dll on my Windows 7 64-bit machine and IIS has no problems referencing it.
I have tried registering the dll using the following command on the Windows Server 2008 box using the following command:
c:\windows\system32\regsvr32.exe <filename>.dll
I get the message that it has registered successfully, but when I run the web site I get the following exception:
Retrieving the COM class factory for component with CLSID {...} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
I've tried restarting IIS.
I've seen the this article, but re-installing windows is not the optimum solution.
- Any thoughts on what could be causing this problem?
- Also, why is Windows 7 working and Windows Server 2008 not?
Best Answer
The answer is to edit the Advanced Settings of the app pool in IIS. Then on that dialog set "Enable 32-bit Applications" to true.