This is the second part of a four-part series on using Team Foundation Server and Team Build to set up a continuous deployment environment.
- Part One: Getting the Lay of the Land
- Part Two: Preparing the Project for Continuous Deploy
- Part Three: Creating the Team Build for Continuous Deploy
- Part Four: Performing Parameterized Deployments with Web Deploy
In this post, we walk through setting up the web project so that all the pieces are in place for enabling the build to deploy the end product.
Select Build -> Configuration Manager from the Visual Studio menu and then select New from the Active Solution Configuration drop down.
Enter a name that matches the deploy environment. We typically use “Dev” as the development integration environment name.
The principal reason for creating solution configurations is to enable Configuration Transformations. This is the new MSBuild pipeline method for separating out environment specific configurations and having them “injected” into the configurations that get copied during the package and deploy process. In-depth information can be found here: http://msdn.microsoft.com/en-us/library/dd465326.aspx.
Right-click the Web.config in the project and select “Add config transforms.” A new file will be added for each configuration found in the project. The new files will be displayed in the Solution Explorer nested underneath the Web.config file and named after the project configuration (i.e. Web.dev.config). Add environment specific configuration values (i.e. Connection string server names, WCF endpoints, etc.) to the new file following the tags in the XDT namespace.
In the following example the connection string found in the original web.config named “ApplicationServices” will be replaced by the value in the connectionString property.
Now that the project is all configured to allow different settings for different environments, we will turn our attention to setting up the Team Build in TFS in the next post.