错误描述:编译时没有问题,运行后无法加载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
本文介绍从ArcGIS 9.3迁移到10.0时遇到的加载shape图层失败问题及解决方法,包括添加引用、设置RuntimeManager绑定等步骤。
6580

被折叠的 条评论
为什么被折叠?



