当在.cs文件的开头添加“using System.Configuration;”语句后,仍然不能找到类“ConfigurationManager”,编译时会出现这个错误:“The name 'ConfigurationManager' does not exist in the current context”,那么很可能还没有添加对System.Configuration引用。
那么怎样添加对System.Configuration引用呢?先打开Solution Explore,张开Project,右击节点Refrences,选择Add References...,在弹出的Add Reference对话框中选择.NET页,找到System.Configuration,选择它,点击确定按钮,就完成了添加,其他引用也类似。