Friday, April 30, 2010

how to make web deployments with .net C# and VSTS 2010

visual studio 2010 introduce finally a solution for the paradigma of test / live config files. the solution is a config transformation per xsl.

Step 1:

Once you have executed this you get 2 web.config files:

- web.debug.config
- web.release.config

if you want you have also the ability to add additional config files as long as you support the naming convention: web.integration.config. The files area actually only contain the changes and are not copies of you main config files.

Step 2:
so here an example how to manage that:

<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl="" version="1.0">
<xsl:template match="@*|node()">
<xsl:apply-templates select="@*|node()"/>
<xsl:template match="/configuration/appSettings">
<xsl:apply-templates select="node()|@*"/>
<xsl:element name="add">
<xsl:attribute name="key">NewSetting</xsl:attribute>
<xsl:attribute name="value">New Setting Value</xsl:attribute>

more infos and samples can be found here.

No comments:

Shared Cache - .Net Caching made easy

All information about Shared Cache is available here: Its free and easy to use, we provide all sources at codeplex.

Facebook Badge