Error: System.ComponentModel.LicenseException: You must have a license to use this ActiveX control, at System.Windows.Forms.AxHost.CreateInstance()
After installing ArcGIS Engine Runtime, by default, the following license/product is selected by the runtime, as is seen in ArcGIS Administrator: ArcGIS Engine (Concurrent Use)
When creating a simple MapControl-based Engine app, and authenticating it programmatically using an ESLF secure Engine license and the following API call:
ESRI.ArcGIS.esriSystem.IAuthorizeLicense.AuthorizeASRFromFile()The following error occurs when running the application:
System.ComponentModel.LicenseException: You must have a license to use this ActiveX control, at System.Windows.Forms.AxHost.CreateInstance() at ......................
The cause of this error is that the wrong product/license option is selected in ArcGIS Administrator (as mentioned above, this is default behavior when ArcGIS Engine is freshly installed).
Solution or Workaround
- Open ArcGIS Administrator, and inspect the option selected under the Select a product pane. If the only license available is the ESLF Engine License, and you do not have access to an Engine DevKit or Floating license, the following product options lead to an error:
- ArcGIS Engine (Concurrent Use)
- ArcGIS Engine and ArcGIS Engine Developer Kit (Single Use)
- Select a product/license that corresponds to the ArcGIS Engine ESLF Single Use license:
- ArcGIS Engine (Single Use)