How can I get TFS 2010 to build each project to a separate directory?

后端 未结 9 932
忘掉有多难
忘掉有多难 2020-12-23 12:37

In our project, we\'d like to have our TFS build put each project into its own folder under the drop folder, instead of dropping all of the files into one flat structure. To

9条回答
  •  无人及你
    2020-12-23 13:05

    I figured out a nice way to do it. It turns out that since you can set the OutDir to whatever you want within the workflow, if you set it to the empty string, MSBuild will instead use the project-specific OutputPath. That lets us be a lot more flexible. Here's my entire solution (based on the default build workflow):

    In the Run MSBuild task, set OutDir to the empty string. In that same task, set your CommandLineArguments to something like the following. This will allow you to have a reference to the TFS default OutDir from your project:

    String.Format("/p:CommonOutputPath=""{0}\\""", outputDirectory)
    

    In each project you want copied to the drop folder, set the OutputPath like so:

    
        bin\Release\
        $(CommonOutputPath)YourProjectName\bin\Release\
    
    

    Check everything in, and you should have a working build that deploys each of your projects to its own folder under the drop folder.

提交回复
热议问题