C#开发ArcEngine中最简单的一个例子MapViewer,出现了这种错误
“System.Runtime.InteropServices.COMException”类型的未经处理的异常在 System.Windows.Forms.dll 中发生
“System.Runtime.InteropServices.COMException”类型的未经处理的异常在 System.Windows.Forms.dll 中发生
其他信息: ClassFactory 无法供应请求的类 (异常来自 HRESULT:0x80040111 (CLASS_E_CLASSNOTAVAILABLE))
解决
Main()函数的最前面加
ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.EngineOrDesktop);
ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.Engine);