Provide your license server administrator with the following information:Error Code = -42 FlexNet Licensing error:-42,147
报告错误
---------------------------
Problem Connecting to License Manager
---------------------------
Provide your license server administrator with the following information:
Error Code = -42
Invalid parameter.
License path: @DESKTOP-XXXXX;【主机名脱敏】
FlexNet Licensing error:-42,147
ArcGIS for Desktop/Engine 10.2 cannot connect to previous versions of the ArcGIS License Manager.
Please contact your organization's License Administrator to ensure that your License Manager is version 10.2 or newer.
据大佬所说:arcEngine10授权部分代码写法的问题!bind绑定部分代码重新写,arcEngine9.3的授权部分代码写法在10.0版中有问题
可能是与AE许可绑定代码有关。具体怎么回事,哪句所导致没去验证。
可能是用了下面语句,中某句或者是放在错误位置所导致。
//#region 初始化许可
//IAoInitialize m_AoInitialize = new AoInitializeClass();
//esriLicenseStatus licenseStatus = esriLicenseStatus.esriLicenseUnavailable;
////licenseStatus = m_AoInitialize.Initialize(esriLicenseProductCode.esriLicenseProductCodeArcInfo);
//licenseStatus = m_AoInitialize.Initialize(esriLicenseProductCode.esriLicenseProductCodeAdvanced);
//if (licenseStatus == esriLicenseStatus.esriLicenseNotInitialized)
//{
// MessageBox.Show("没有esriLicenseProductCodeArcInfo许可!");
// Application.Exit();
//}
//else if (licenseStatus == esriLicenseStatus.esriLicenseUnavailable)
//{
// MessageBox.Show("没有esriLicenseProductCodeArcInfo许可!");
// Application.Exit();
//}
//m_AoInitialize.CheckOutExtension(esriLicenseExtensionCode.esriLicenseExtensionCode3DAnalyst);
//#endregion
解决办法
1.删掉以上代码。
2.重新添加控件
3.重新添加ESRI.ArcGIS.version、ESRI.ArcGIS.System引用
4.重新生成解决方案(如未改正错误重新生成解决方案会再次出现该问题。)
本文参考
https://blog.csdn.net/hsg77/article/details/46544113#commentsedit