Use App.config transform in tfs

I recently needed to deploy a windows service using a tfs build. One of the problems of automating builds for a windows service, or windows app, is that MSBuild has no native support for application configurations transform.

This is weird because build transforms are automagically supported for web projects, I am not sure why Microsoft did not add the required plumbing to support config files for any kind of projects.

However, they have a Visual studio extension that will provide transforms for any project type with a simple right click –> Add transforms. In addition, the most beautiful part, it ships with a nuget package to automate the transform in the build process.

To install it, simply go to Tools -> Extensions & Update , then go to the online tab and search for SlowCheetah

Install, restart visual studio.

Now you can simply right click a config file and select Add transforms.

You will be prompted to add a Nuget package (SlowCheetah) , that is in charge to automate the transform at build time.

It’s simple, easy, and worked out of the box without any changes inside our TFS build

Submit a Comment

Your email address will not be published. Required fields are marked *

Share This