2012-04-25 51 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位进程加载。