【问题标题】:Multiple external files in web.config?web.config 中有多个外部文件?
【发布时间】:2011-03-19 05:37:23
【问题描述】:

我需要这样做:

<appSettings>
  <add key="Three" value="NumberThree"/>    
</appSettings>
<appSettings configSource="One.config"/>
<appSettings configSource="Two.config"/>

这给了我一个错误:Sections must only appear once per config file.

这有点糟糕 :( 只是想知道:有什么方法/设置可以让我做这样的事情吗?(IIS7,.net 3.5SP1)

我对 web.config 几乎没有控制权,无法修改现有的 appSettings 元素,只能添加新项目。

【问题讨论】:

    标签: .net iis-7 web-config


    【解决方案1】:

    【讨论】:

      【解决方案2】:

      不确定这是否会对您的特定情况有所帮助。 查看&lt;appSettings&gt; 上的file 属性

      <appSettings file="Two.config">
        ...
      </appSettings>
      

      Two.config 中你可以做同样的事情来指向One.config

      【讨论】:

        猜你喜欢
        • 2011-07-06
        • 2010-11-20
        • 2012-07-31
        • 1970-01-01
        • 2013-09-20
        • 1970-01-01
        • 2012-11-29
        • 2011-01-25
        • 2021-09-09
        相关资源
        最近更新 更多