【发布时间】:2010-05-19 20:53:31
【问题描述】:
在一个小型测试项目中,我目前在 web.config 中有提供程序部分。我想把它移到一个单独的配置文件中,比如 providers.config。我当前的提供者实例化代码如下:
//Get the feature's configuration info
ProviderConfiguration pc = (ProviderConfiguration)ConfigurationManager.GetSection(DATA_PROVIDER_NAME);
如果提供程序信息在 web.config 中,则此代码有效,但是如何从另一个文件(如 providers.condfig)中读取此信息,因为似乎 ConfigurationManager “读取”仅 web.config 文件。我可能在这里遗漏了一些非常简单的东西:)
希望对此有更多意见。
谢谢 V
【问题讨论】:
-
我已经用我自己的配置部分测试了编辑,它工作正常。