WebConfigReplacement not works for appSettings with configSource attribute

Last post 06-18-2009 4:27 AM by Thomas Sun – MSFT. 1 replies.

Sort Posts:

  • WebConfigReplacement not works for appSettings with configSource attribute

    06-15-2009, 4:54 AM
    • Contributor
      4,580 point Contributor
    • stmarti
    • Member since 06-06-2006, 8:20 AM
    • Posts 972

    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?

     

     

     

  • Re: WebConfigReplacement not works for appSettings with configSource attribute

    06-18-2009, 4:27 AM
    Answer

    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.

    Thomas Sun
    Microsoft Online Community Support

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question.
Page 1 of 1 (2 items)