ArcEngine 无法打开shape(打开工作空间出现 COM Exception 0x80040228错误)

错误描述:编译时没有问题,运行后无法加载shape图层;

运行到该代码:

            //创建工作空间
            IWorkspaceFactory pWorkspaceFactory = new ShapefileWorkspaceFactory();
            IFeatureWorkspace pFeatureWorkspace = (IFeatureWorkspace)pWorkspaceFactory.OpenFromFile(fileFolder, 0);

出现:COM Exception 0x80040228错误

添加AxLicense控件也无法解决。

最终使用下述方法解决问题:

When we migrate our code from ArcGis 9.3 to ArcGis 10 then this type of error occurs. 

1.First we add Reference ESRI.ArcGis.ADF.Local

2.Add Reference ESRI.ArcGis.Version

3.Add Line 

“ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.Desktop); ”

prior to call any arcgis object.

4.In all ArcGis Reference property "Specific Version" set to false.

5.Now Go to Project menu of visual studio and there are one option "Add ArcGis License Checking" and Add this file to your project.

参考:

http://www.bubuko.com/infodetail-478122.html


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值