【发布时间】:2010-12-30 20:11:36
【问题描述】:
我有一个 C# 类库 A,它的 App.config 中有一些配置设置,我使用
访问它们Method1()
{
string connectionString = ConfigurationManager.AppSettings["ConnectionString"];
}
但是当我从我的 ASP Web 项目 B 中调用方法 1() 时,它在类库 A 中找不到配置设置
知道这里发生了什么吗?
【问题讨论】:
-
对于 Web 应用程序,使用
WebConfigurationManager而不是 ConfigurationManager
标签: c# configuration app-config configurationmanager