I would suggest using completely different configuration files for each environment (prod, test, staging in our case). Depending on the build, you will just use the required configuration, clutter, less fuss. Hanselmen has an example of how to do this in Visual Studio, and if you read the first comment, Phil Hack got it working with NAnt .
<target name="configMerge"> <copy file="${sourcefile}" tofile="${destinationfile}" overwrite="true"> <filterchain> <expandproperties /> </filterchain> </copy> </target>
In addition, if you are using VS 2010, you can now use the convert web.config
cgreeno
source share