我没有意识到:'在一个单独的类库中有一个web.config,而且'是从不同的Web应用程序读取web.config应用设置。
我正在使用VS2010目标框架3.5
我不知道这里有什么问题,但是当我尝试获取ConfigurationManager.AppSettings["StoreId"];
时,我得到了null
。
private string _storeid = GetStoreId;
public static string GetStoreId
{
get
{
return ConfigurationManager.AppSettings["StoreId"];
}
}
web.config:
<appSettings>
<add key="StoreId" value="123" />
</appSettings>