Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# Windows Server 2008中COM对象的InvalidCastException_C#_Windows_Iis_Com - Fatal编程技术网

C# Windows Server 2008中COM对象的InvalidCastException

C# Windows Server 2008中COM对象的InvalidCastException,c#,windows,iis,com,C#,Windows,Iis,Com,我有一个与Windows Server 2008(x64版本)上IIS7上部署的C#服务通信的站点存在问题。 服务正在尝试从第三方dll访问COM对象。执行此操作时,将引发以下形式的异常: System.InvalidCastException: Unable to cast COM object of type 'MyClass' to interface type 'TheirInterface'. This operation failed because the QueryInterf

我有一个与Windows Server 2008(x64版本)上IIS7上部署的C#服务通信的站点存在问题。 服务正在尝试从第三方dll访问COM对象。执行此操作时,将引发以下形式的异常:

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)).
我在许多其他使用Windows7的机器上托管了同一个站点,因此我认为问题与操作系统(WindowsServer2008)有关。
关于我是否可以搜索此异常的解决方案,或者是否应该在IIS上进行任何配置的任何建议?

您需要将网站作为32位网站运行,或者使用针对x64平台编译的COM对象。换句话说,您的COM对象无法加载,因为它只支持由32位进程加载