0

We have DEV / QA / Prod sites as follows:

dev: something.dev.org
qa: something-qa.dev.org/
prod: something.org/

Ideally I would like there to be somewhere in TFS that has multiple config files that I would grab conditionally, based on what build configuration is currently selected.

Example: app.config files, robots.txt files, each with their own versions for dev, qa, and prod, in TFS.

What are best practices for achieving this kind of thing?

using TFS 2010.

Sincerely, n00b.

dah97765
  • 679
  • 1
  • 13
  • 29
  • See related: http://stackoverflow.com/questions/4751140/tfs-build-not-transforming-web-config-as-expected – Mrchief Aug 15 '11 at 15:54

1 Answers1

1

You can consider using conditional ItemGroup in project file:

<ItemGroup Condition=" '$(Configuration)' == 'Release' ">
    <None Include="app.config">
      <SubType>Designer</SubType>
    </None>
</ItemGroup>

But this means project file should be edited in text editor and not sure whether VS will preserve these changes after manipulations with project files.

Konstantin
  • 26
  • 1
  • This works very well. Sometimes I have trouble with the changes to the project files sticking, but it seems to work well otherwise. – dah97765 Aug 15 '11 at 19:05