none
How to insert settings in WCF library DLL's app.config into web.config? RRS feed

  • Question

  • Hi,

    I have a WCF service project A which references a WCF library dll B. The library dll requires some input parameters from its app.config file as below.

    <addkey="StartTimeUtc"value="xyz"/>

    <addkey="EndTimeUtc"value="zyx"/>

    Sicne project A will only get config values from web.confg, my question is where should I store the values in dll's app.config to make it work?  

    Any example will help too!

    Thanks,

    Penny

    Tuesday, July 29, 2014 9:22 PM

All replies

  • The same place, really.  You replicate the structures from the app.config into the web.config.

    You just need to copy the <add/> node, along with its parent nodes and any leading registration nodes in the app.config. 

    Vague advice, but post the config files if you have trouble.

    David


    David http://blogs.msdn.com/b/dbrowne/

    Tuesday, July 29, 2014 9:25 PM
  • Thanks David. Here's my app.config for library dll:

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
      <appSettings>
        <add key="Enabled" value="true" />
        <add key="StartTimeUtc" value="07/26/2014 10:00:00 pm" />
        <add key="EndTimeUtc" value="07/26/2014 11:00:00 pm" />   
      </appSettings>
    </configuration>

    Should I put those app settings in AppSettings section of project A's web.config? 

    <appSettings>

      <addkey="maxValue"value="200"/>

      <addkey="maxApps"value="30"/>

        <Add values here? />

    </appSettings>

    Tuesday, July 29, 2014 9:33 PM
  • Does anyone else know? Thanks.
    Tuesday, July 29, 2014 11:40 PM
  • >Should I put those app settings in AppSettings section of project A's web.config? 

    Yes.

    David


    David http://blogs.msdn.com/b/dbrowne/

    Wednesday, July 30, 2014 1:02 AM
  • Thanks David. It worked.
    Monday, August 11, 2014 6:57 PM