Layer loading failed! Exception from HResult: 0x80040228

When loading ShapeFile data in ArcEngine development, an error is reported: “layer loading failed! Exception from HResult: 0x80040228 “. The problem number belongs to the authorization problem. First, check whether to add a license control. After it has been added, it is found that the error reporting place is when creating the ShapeFile workspace, the following methods are adopted to solve the problem.

Open the program.cs class and add the following code in the corresponding position of the class:

(1)using ESRI.ArcGIS.esriSystem;

(2)

IAoInitialize m_aoinitialize = new AoInitializeClass();
m_aoinitialize.Initialize(esriLicenseProductCode.esriLicenseProductCodeEngine);  

As follows:


Read More: