Craig
Craig

Reputation: 77

IIS 64bit Com dll

Hi I'm developing an app where i need to access a com DLL via a web service.

I'm running IIS 7 on win 7 and developing using vs2010.

Everything works fine in the development environment but when I went to publish to IIS on my localhost to do some further testing I was getting the following error:

System.Runtime.InteropServices.COMException: Retrieving the COM class factory for component with CLSID {29345FBB-4DE7-4838-9464-5A886B775677} failed due to the following error: 80040154.

I looked this up and found that If I changed my app pool settings to "Enable 32 Bit Applications" to true. That this would get round the error, I did this and now I am getting the following error:

Unable to cast COM object of type 'ComName.ComClassClass' to interface type 'ComName._ComClass'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{003B251B-6F4E-42A5-8111-11DB41F1D14A}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).

Im completely lost as to where to look, Have googled it an can't seem to find an answer is there anyone that knows what is going on?

Upvotes: 4

Views: 417

Answers (1)

Carlos Quintanilla
Carlos Quintanilla

Reputation: 13303

COM dlls need to be registered on the IIS server. Install the software that installs that COM dll or do it yourself manually using regsvr32.exe "C:..\yourdll.dll"


[Window Title] RegSvr32

[Content]

To register a module, you must provide a binary name.

Usage: regsvr32 [/u] [/s] [/n] [/i[:cmdline]] dllname

/u - Unregister server

/s - Silent; display no message boxes

/i - Call DllInstall passing it an optional [cmdline]; when used with /u calls dll uninstall

/n - do not call DllRegisterServer; this option must be used with /i


If you think it is already registered then unregister it and re-register it, and maybe do a iisreset :)

Example (assuming your dll is directly in C:\ ):

C:>regsvr32.exe /u thecomdll.dll

C:>regsvr32.exe thecomdll.dll

Upvotes: 3

Related Questions