Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Problems with MSBuild OutputPath and OutDir in TFS2010

Tags:

msbuild

We have a very large solution (some 300+) projects and we are trying to build it via MSBuild on TFS2010. We can build it via MSBuild on all out development machines, and are in the process of adopting TFS.

The structure of our code is like so:

bin\Client
bin\Server
Framework\ClientFramework.csproj
Modules\Module1\Project1
Modules\Module2\Project2
etc.

Each project has a relative OutputPath which builds the code to the bin Client or Server directory. So for example, Project1.csproj has an OutputPath of "..\..\bin\Client".

We seem to be having a problem that in TFS MSBuild the OutDir is set to a Fixed Path:

C:\Builds\MyProject\Binaries\

So things are getting confusing when resolving the relative OutputPath on top of the OutDir

  • ClientFramework goes to C:\Builds\MyProject\Binaries\..\bin\Client
  • Project1 goes to C:\Builds\MyProject\Binaries\..\..\bin\Client
  • etc.

We also have some Post build events that copy some 3rd Party dll's to the bin folders, these paths cannot be resolved properly either.

I think the solution we are after is to build everything to our existing bin\Client, bin\Server structure and then move the Folders from bin to Binaries.

Any ideas on how to accomplish this or how we should be working, are appreciated, but updating our existing projects might prove problematic, as it all works with VS, developer command line builds and with CC.net.

like image 812
DaveShaw Avatar asked Jun 28 '11 09:06

DaveShaw


1 Answers

Since this is first link that pops up with a Google search of "TFS OutDir", I must provide a newer solution. I spent an entire day playing around with OutDir, OutputPath, and overriding them with TeamBuildOutDir. A better solution is to set the MSBuild property GenerateProjectSpecificOutputFolder. It comes with .NET 4.5. More info here: http://blog.codeassassin.com/2012/05/10/override-the-tfs-team-build-outdir-property-net-4-5/

like image 133
Cameron Taggart Avatar answered Sep 23 '22 03:09

Cameron Taggart