2012-04-25 52 views
0

我與在Windows Server 2008(x64版本)上的IIS7上部署的C#服務通信的站點存在問題。 服務試圖從第三方DLL訪問COM對象。如果這樣做以下形式的異常被拋出:Windows Server 2008中COM對象的InvalidCastException

System.InvalidCastException: Unable to cast COM object of type 'MyClass' to interface type 'TheirInterface'. 
This operation failed because the QueryInterface call on the COM component for the interface with IID '{88B11E8A-0B27-459C-BC28-A4D4113FD4AE}' failed due 
to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)). 

我主持許多在Windows 7上工作的其他機器在同一地點,所以我想這個問題是關係到操作系統(Windows Server 2008中) 。 任何關於我可以搜索此異常的解決方案的建議,或者是否應該在IIS上進行任何配置?

回答

2

您需要將網站作爲32位網站運行,或使用針對x64平臺編譯的COM對象。換句話說,您的COM對象無法加載,因爲它只支持由32位進程加載。