在类库中无法使用ConfigurationManager

需要先引用DLL文件:

C:WindowsMicrosoft.NETFrameworkv2.0.50727System.configuration.dll

然后才可以使用

System.Configuration.ConfigurationManager.AppSettings["SiteUrl"]

原文地址:https://www.cnblogs.com/zhangwei595806165/p/3555551.html