views:

159

answers:

1

Our Team Foundation Server has to build three different versions of the same solution. The only difference between them is the app.config file which should be changed for each build. How do I select correct file during the build?

What I want to do is switch app.config file and then build, repeat for each file. Ie:

<Replace file="app.config" with="app.config.one"> <!-- and then -->
<SolutionToBuild Include="project.sln"/>

<Replace file="app.config" with="app.config.two"> <!-- and then -->
<SolutionToBuild Include="project.sln"/>

<Replace file="app.config" with="app.config.three"> <!-- and then -->
<SolutionToBuild Include="project.sln"/>

(I realise the above is näive, but it shows what I want to do).

I have tried setting properties back and forth, using BeforeCompileSolution etc etc but nope.

Btw, this is a ClickOnce project (using the Publish target), so I have to select the correct app.config file before the compilation step due to file integrity checks as explained in this question.

A: 

This seems to be impossible, so I created three different builds to solve it. Each build copies a single file in the pre-build target. I now have three tfsbuild.proj files which is exactly the same, except for the file name. Sucks, but it works.

Martin Wickman