调试的时候出现 问题:
ArcGIS version not specified. You must call RuntimeManager.Bind before creating any ArcGIS components.
解决方法:
ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.EngineOrDesktop);
在porgram.cs中添加上述代码,位置参考如下:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
namespace _5_MyGIS
{
static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.EngineOrDesktop);
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new _5_MyGIS.Forms.MainForm());
}
}
}