~mkw

Average guy, above average luck...the blog of M. Keith Warren

REQ: ASP.NET Feature

For web.config files

<configuration Name=”Release”>
    <system.web>
 …
    system.web>
configuration>
<configuration Name=”Debug”>
    <system.web>
 …
    system.web>
configuration>

If ASP.NET could parse config files while understanding build context and use the configuration for the appropriate build type, it would be a huge help especially for systems which have a large number of custom settings or differences between their development, staging and production environments.

Comments

Scott Galloway said:

Not exactly what you want...but you can use a user.config file for appSettings e.g.:

appSettings file="user.config"

You then just use a user.config for each environment - that way your user.config can stay the same...
# September 17, 2003 10:43 AM

Yves Reynhout said:

Include a Release.Web.config in your assembly as an embedded resource and stream it to disk using a .NET Installer Class when you install your software.
# September 17, 2003 1:28 PM

Wayne Allen said:

We created a wrapper around AppSetting and ConfigurationSettings that looked at various things (machine name, database server, ...) to determine the environment and use the correct settings. I.e.

<test-environment>
<add key="config-section-setting" value="test1" />
<add key="duplicate-setting" value="from test section" />
<add key="custom-section" value="machine-env-mapping" />
</test-environment>

<alternate-environment></alternate-environment>

<!-- Include the common machine to environment mappings -->
<machine-env-mapping>
<add key="test-machine" value="test-environment" />
<add key="alternate-machine" value="alternate-environment" />
</machine-env-mapping>
# September 17, 2003 1:33 PM

sdgfsd said:

rttttttttty
# April 8, 2004 2:17 AM
Leave a Comment

(required) 

(required) 

(optional)

(required)