Handling External developer-specific AppSettings for web.config

This snippet illustrates how developers can check in web.config to Source Control, yet maintain customized individual separate appSettings which take precedence:

<?xml version="1.0" encoding="utf-8" ?>
<compilation defaultLanguage="c#" debug="true" />
<appSettings file="debugsettings.config"/>

<!--separate file debugsettings.config-->
<add key="ConnectionInfo" value="server=(local);database=Northwind;Integrated Security=SSPI" />

<!--If the external file is present, ASP.NET will combine the appSettings values from web.config
with those in the external file. If a key/value pair is present in both files,
ASP.NET will use the value from the external file. -->

Submission Date:  10/18/2005 12:02:43 PM
Submitted By:  Peter Bromberg
My Home Page:  http://www.eggheadcafe.com

By Peter Bromberg   Popularity  (596 Views)