解决办法:在项目中添加System.Configuration引用。 转载于:https://www.cnblogs.com/2008freestyle/archive/2012/03/15/2398046.html