【发布时间】:2015-02-20 16:52:13
【问题描述】:
我可以将 appSettings 拆分为多个外部配置文件并将它们包含在主 web.config 中吗?
这是我尝试过的,但它不起作用:(
在 web.config 中我定义了一个新部分:
<configSections>
<section name="ssoConfiguration" type="System.Configuration.NameValueSectionHandler"/>
</configSections>
下面我有这个部分:
<ssoConfiguration>
<add key="SSOEnabled" value="true"/>
</ssoConfiguration>
当我调用 System.Configuration.ConfigurationManager.AppSettings["SSOEnabled"] 时,它返回 null。
任何想法为什么?
另外,我将有多个带有此类 appSettins 的部分 - 是否可以在多个外部配置文件中定义它们并将它们包含在主 web.config 中?
谢谢。
【问题讨论】:
标签: asp.net web-config configsection