检索 COM 类工厂中&nbsp…

本文介绍了解决在64位.NET应用中加载ArcObjects COM组件时出现的错误问题。该错误表现为尝试加载特定CLSID的组件时失败,并返回错误代码80040154。通过设置项目的平台目标为x86,可以有效避免这一问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

  Message="检索 COM 类工厂中 CLSID 为 {E01BE902-CC85-4B13-A828-02E789E0DDA9} 的组件时失败,原因是出现以下错误: 80040154。"

------------------------------------------------------------------------------------------------------------

一直以为是Engine的安装版本与机器上的其他ArcGIS产品的版本不符,可是最后折腾到了一台没有装ArcGIS产品的服务器上,问题依旧。VS调试发现,从程序的入口检查License文件开始便报如上错误。在确认ArcEngine的运行许可可用的前提下,究竟是什么问题导致的这种情况呢?最后,在ESRI的Supports中找到了相关信息,源网址为http://forums.esri.com/thread.asp?c=159&f=1707&t=219248&mc=6

解决方法:

The ArcObjects COM components can't be loaded by a 64-bit .Net app and the default compilation of a new project is for "Any CPU." Check the Build tab under the project properties and set the platform target to x86。

Right click on the top icon in the Solution Explorer and select the Properties entry in the context menu. In the Properties page, select the Compile tab to the left, then clock the Advanced Compile Options button. This will bring up the Advanced Compiler Settings dialog. The last entry in the dialog is the Target CPU combobox, which defaults to the value AnyCPU. Change that to x86 and click OK.

This will solve the problems that manifest as an InnerException when you try to launch the app:

error number: "-2147221164"
message: "Retrieving the COM class factory for component with CLSID {E01BE902-CC85-4B13-A828-02E789E0DDA9} failed due to the following error:


作者: 水木    
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值