Arcgisengine two times in the development, the geoprocessing, namely: Intersect operation, intersection take counter operation, erase operation and so on, if the permission is improperly assigned, it will appear on the face of COM component call returned error HRESULT e_fail error
The reasons for this are as follows: In the case of Erasure, intersection inversion, and other advanced operations, must be arcgisinfo level of license authorization, otherwise cannot operate, and intersect operation with arcgisengine level. (unstable, error-prone, recommendation 2)
The solution is as follows: 1. Use the Licencecontrol control to select the Arcgisinfo option, and select the spatial analysis
2. Add some code to the project startup Main method
ESRI. ArcGIS.RuntimeManager.Bind (ESRI. ArcGIS.ProductCode.EngineOrDesktop); #region Initialize license iaoinitialize m_aoinitialize = new Aoinitializeclass (); Esrilicensestatus licensestatus = esrilicensestatus.esrilicenseunavailable; LicenseStatus = M_aoinitialize.initialize (esrilicenseproductcode.esrilicenseproductcodearcinfo); if (LicenseStatus = = esrilicensestatus.esrilicensenotinitialized) { MessageBox.Show (" No esrilicenseproductcodearcinfo permission! "); Application.exit (); } #endregion
One of the ESRI.ArcGIS.RuntimeManager.Bind (ESRI. ArcGIS.ProductCode.EngineOrDesktop); Two methods are required.
Note: You must have high permissions in front of the authorization, otherwise it will not work, the license to be added from high to low, from high to low sort: esrilicenseproductcodearcinfo, Esrilicenseproductcodearceditor, Esrilicenseproductcodearcview, Esrilicenseproductcodearcserver, Esrilicenseproductcodeenginegeodb, Esrilicenseproductcodeengine
AE development, call to COM component returned error HRESULT E_fail, error in geoprocessing, i.e. GP tool processing