divide appSettings between web.config and a section in external file

  • Thread starter Thread starter Sergei Shelukhin
  • Start date Start date
S

Sergei Shelukhin

Hi.
Is is possible to divide appSetting in two, having some values stored
in web.config itself and some in a section referenced in appSettings
file="...." attribute?
 
Yes. Create a user.config file.

in your web.config you want...

<appSettings file="user.config">

in your user.config, you want...
<?xml version="1.0" encoding="utf-8" ?>

<appSettings>

</appSettings>

You will then stick your keys inbetween the appsettings. Note, any keys in
user.config will override any keys of the same name in the web.config.

The idea being that you have a standard web.config that is the same as your
live web.config (including your database settings) and your local
user.config overrides those DB settings. What's more, you don't even have to
have a user.config on your server even if your web.config looks for it.

--
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available
 
Back
Top