简体   繁体   English

无法将类型'System .__ ComObject'的COM对象转换为IRTDUpdateEvent的接口类型

[英]Unable to cast COM object of type 'System.__ComObject' to interface type for IRTDUpdateEvent

I have spent a lot of time trying to figure out why I am getting the following error when trying to run RTD Server (Excel RTD Server) that I have developed when installing it via RegAsm. 我花了很多时间试图弄清楚为什么我在运行通过RegAsm安装RTD Server(Excel RTD Server)时遇到以下错误。 It works fine if I set the Register for COM interop flag on my dev machin, but not when install it using RegAsm. 如果我在我的开发机器上设置了“注册COM互操作”标志,则工作正常,但在使用RegAsm安装该标志时却没有。

System.InvalidCastException: Unable to cast COM object of type 'System.__ComObject' to interface type 'IRTDUpdateEvent'. System.InvalidCastException:无法将类型为“ System .__ ComObject”的COM对象转换为接口类型为“ IRTDUpdateEvent”。 This operation failed because the QueryInterface call on the COM component for the interface with IID '{A43788C1-D91B-11D3-8F39-00C04F3651B8}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)). 该操作失败是因为由于以下错误而导致IID为'{A43788C1-D91B-11D3-8F39-00C04F3651B8}'的接口的COM组件上的QueryInterface调用由于以下错误而失败:不支持此类接口(HRESULT的异常:0x80004002(E_NOINTERFACE)) 。

Any Ideas? 有任何想法吗?

您的介面「IRTDUpdateEvent」是否有这个Guid?

Thanks Arthur, 谢谢亚瑟,

I have at last managed to crack it. 我终于设法破解了。 The problem was that when creating a setup package, I referenced the Assembley in my Custom Installation. 问题是,在创建安装程序包时,我在“自定义安装”中引用了“程序集”。 It obviously did not like that when runing RTD. 运行RTD时显然不喜欢这样。 The RegAsm was in my custm installation. RegAsm位于我的自定义安装中。 I solved the problem by leaving Register for COM interop flag checked and then adding the Assembley in my setup project by right clicking and sellecting Add --> Assembley. 我通过保留“注册COM互操作”标记为选中状态,然后右键单击并出售“添加->组装”,将组装添加到我的安装项目中,从而解决了该问题。

Thanks 谢谢

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 :'无法将类型为'System .__ ComObject'的COM对象转换为接口类型 - : 'Unable to cast COM object of type 'System.__ComObject' to interface type 无法使用 STAThread 属性转换类型为“System.__ComObject”的 COM 对象 - Unable to cast COM object of type 'System.__ComObject' with STAThread attribute 无法转换类型为'System .__ ComObject'的COM对象 - Unable to cast COM object of type 'System.__ComObject' 无法转换'System .__ ComObject类型的COM对象 - Unable to cast COM object of type 'System.__ComObject SAP:无法将“System.__ComObject”类型的 COM 对象转换为接口类型“sapfewse.GuiTextField” - SAP: Unable to cast COM object of type 'System.__ComObject' to interface type 'sapfewse.GuiTextField' System.InvalidCastException:无法将类型为“System .__ ComObject”的COM对象强制转换为接口类型“System.Collections.IEnumerable” - System.InvalidCastException: Unable to cast COM object of type 'System.__ComObject' to interface type 'System.Collections.IEnumerable' 在C#中加载COM对象抛出异常“无法将类型为'System .__ ComObject'的COM对象转换为接口类型...”,但C ++或VB没有 - Loading COM object in C# throws exception “Unable to cast COM object of type 'System.__ComObject' to interface type …”, but C++ or VB not 无法将类型为“System.__ComObject”的 COM 对象转换为接口类型“Interop.PeachwServer.Application” - Sage SDK 2018 CreateCustomerDemo c# - Unable to cast COM object of type 'System.__ComObject' to interface type 'Interop.PeachwServer.Application' - Sage SDK 2018 CreateCustomerDemo c# 无法将类型为“ System .__ ComObject”的COM对象转换为类类型AgentInfo - Unable to cast COM object of type 'System.__ComObject' to class type AgentInfo 获取 CLR 对象属性引发无法转换类型为“System.__ComObject”的 COM 对象 - Getting CLR object property raises Unable to cast COM object of type 'System.__ComObject'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM