:::: MENU ::::

Tuesday, June 2, 2009

We have earlier discussed about Web Deployment and Web Packaging quite a bit, today I wanted to dive into web.config transformation. If you would like to check out the other topics please read through the earlier blog posts below:

·         Web Deployment with VS 2010 and IIS

·         Web Packaging: Creating a Web Package using VS 2010

·         Web Packaging: Creating web packages using MSBuild

·         How does Web Deployment with VS 10 & MSDeploy Work?

·         Installing Web Packages using Command Line

Usually web applications go through a chain of server deployments before being finally being deployed to production environment. Some of these environments can be Developer box (Debug), QA Server, Staging/Pre-Production, Production (Release). While transitioning between these environments various settings of the web application residing in web.config file change, some of these settings can be items like application settings, connection strings, debug flags, web services end points etc.

VS10’s new web.config transformation model allows you to modify your web.config file in an automated fashion during deployment of your applications to various server environments. To help command line based deployments, Web.Config transformation is implemented as an MSBuild task behind the scene hence you can simply call it even outside of deployment realm.

I will try to go through below steps to explain web.config transformation in detail

1.       Creating a “Staging” Configuration on your developer box

2.      Adding a “Staging” Web.Config Transform file to your project

3.      Writing simple transforms to change developer box connection string settings into “Staging” environment settings

4.      Generating a new transformed web.config file for “Staging” environment from command line

5.      Generating a new transformed web.config file for “Staging” environment from VS UI

6.      Understanding various available web.config Transforms and Locators

7.      Using Web.config transformation toolset for config files in sub-folders within the project

More