locked
WebConfigReplacement not works for appSettings with configSource attribute RRS feed

  • Question

  • User1070236303 posted

    I have a web.config file with:

    <appSettings>

        ... keys 

    </appSettings> 

    In the wdp project file I have a WebConfigReplacementFile element which try to replace the above appSettings with this one:

    <appSettings configSource="some path" /> 

    Wdp build fails with: ...Unrecognized attribute 'configSource'. Note that attribute names are case-sensitive...

    Is this a bug in wdp or a limitation?

     

     

     

    Monday, June 15, 2009 4:54 AM

Answers

  • User372121194 posted

    Hi,

    To update the Web.config file by replacing existing sections with elements that reference a .config file, please enable "Use external configuration source file" option.

    For example, the web.config contains appSettings section:

     <appSettings>
      <add key="test" value="AAA"></add>
     </appSettings>

    And there is a config file named SourceConfig.config, containing:

     <appSettings>
      <add key="New1" value="BBB"></add>
     </appSettings>

    In the Web Deployment project, we can directly type appSettings=SourceConfig.config in Web.config file section replacements TextBox.

    After build Web Deployment project, the web.config will become:

    <appSettings configSource="SourceConfig.config" />

     

    I look forward to receiving your test results.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, June 18, 2009 4:27 AM