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:

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


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

<!--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  (452 Views)