需要先引用DLL文件:
C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.configuration.dll
然后才可以使用
System.Configuration.ConfigurationManager.AppSettings["SiteUrl"]
在类库中无法使用ConfigurationManager
原文:http://www.cnblogs.com/zhangwei595806165/p/3555551.html