I want TFS to build my projects into separate folders in Binaries folder. I have found the solution: http://blog.stangroome.com/2012/02/03/override-the-tfs-team-build-outdir-propert (I have to use .Net 4.0). However, I have mane projects in the solution and new projects may be developed by other developers, so I wouldn't like to change every *.csproj file by adding
<OutDir Condition=" '$(PreferredOutDir)' != '' ">$(PreferredOutDir)$(MSBuildProjectName)\</OutDir>
How could I add this line for every project automatically, for example in before.Foo.sln.targets?
Asked
Active
Viewed 502 times
1

Aurimas Šimkus
- 159
- 10
-
Which version of TFS? – James Reed Oct 07 '14 at 10:17
-
which version of TFS? 2012 and 2013 should support individual folders in the build definition – Just TFS Oct 07 '14 at 10:18
-
TFS 2012. I have found individual folders option. I will try it later. But is it possible to do what I wanted previously? – Aurimas Šimkus Oct 07 '14 at 10:37
-
Unfortunately, "Solution Specific Build Outputs = True" option didn't help. I guess, it is because the solution I am working on is using OctoPack which is configured to change OutDir manually and it uses the idea from the link I've attached in my question. I will look for this more, but it would be really nice to have OutDir property set automatically somehow instead of re-factoring the working solution to use "Solution Specific Build Outputs = True" :) – Aurimas Šimkus Oct 07 '14 at 14:19
1 Answers
0
You'll need to touch each one of your projects if you want an architectural solution that allows you to change this property globally from a single location.
Make a separate XML script file called "Common.targets" that is included as an and referenced by each of your projects after the first .
In each of your .csproj files, remove the property and add a after the first PropertyGroup, but make sure does not exist after this import.

Nicodemeus
- 4,005
- 20
- 23