Home > TFS > TFS 2010 Build Automation–Different Folders for each VS Project

TFS 2010 Build Automation–Different Folders for each VS Project

Problem

My Visual Studio solution contains several projects of different kind (Web Apps, Console Apps, etc.). If you are using single TFS Build definition for all projects, then TFS will place all projects output files into the root of Drop folder. It is very hard to manage the output files.

It would be if TFS placed output files of each project in a separate folder. TFS 2010 don’t have this feature  by default, but there is an workaround with two steps.

Step-1

1.1 Select “Run MsBuild for Project” activity from TFS Build Template Workflow.

image

1.2 Update CommandLineArguments with the following
String.Format("/p:SkipInvalidConfigurations=true /p:TeamBuildOutDir=""{0}"" {1}", BinariesDirectory, MSBuildArguments)

1.3 Clear OutDir property.

Step-2

Update PropertyGroup > Ouputpath in all Project files (.csproj / .vbprog) in the Visual Studio Solution, for each configuration.
image

<OutputPath Condition=" ‘$(TeamBuildOutDir)’==” ">bin\Debug\</OutputPath>
<OutputPath Condition=" ‘$(TeamBuildOUtDir)’!=” ">$(TeamBuildOutDir)\WebApplication3\</OutputPath>

That’s it. Hope it helps.

Advertisements
Categories: TFS
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: