Problems with MSBuild OutputPath and OutDir in TFS2010

余生长醉 提交于 2019-11-26 23:23:01

问题


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.


回答1:


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/




回答2:


I found the answer on MSDN : http://msdn.microsoft.com/en-us/library/ff977206.aspx



来源:https://stackoverflow.com/questions/6504202/problems-with-msbuild-outputpath-and-outdir-in-tfs2010

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!