none
TFS 2010 BUILD SERVER: Can not keep folder tree in the drop location ?

    Question

  • When TFS 2010 is building a solution with diffrents windows application projects (or libraries), it does'nt keep the original folder structure (it does for web applications). All Dll end Exe are mixed together.

    I found few solutions on internet to keep the structure (tricks, edting *.csproj...), but they are not really friendly to use with many projects.

    Why does Microsoft choose to mix all projects build of a solution in the same drop location folder ? Is there a clean action to keep the original folder tree ?

    Greg

    Tuesday, June 15, 2010 9:52 AM

Answers

  • Hi Greg,

    This is because the Property OutDir.

    Each project will copy its output to OutDir. By default(like desktop build), the value of OutPut is null and it will use the value of OutputPath(\bin\debug)

    For TeamBuild, TfsBuildHost will pass OutDir as a property to MSBuild, the path is fixed for a solution, so all output will be copied to a folder. This is benefit that only one copy of a assembly will be copied to drop folder.

    To keep the output structure, you have to make TFSBuildHost not pass OutDir to MSBuild and  custom the output path of each project.

    1 Open the build process file, navigate to Compile the Project Sequence, edit the property of Run MSBuild for Project Activity.

     Set OutDir to empty (just make the testbox is empty)

    set CommandLineArguments to String.Format("/p:SkipInvalidConfigurations=true {0} /p:TeamBuildOutDir=""{1}""", MSBuildArguments, outputDirectory)

    2 Modify each project file in the solution.
    2.1 Check out project file to Edit.
    2.2 Open project file  with notepad.
    2.3  Find <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    Use following code to replace the default OutputPath Property.
    <OutputPath Condition=" '$(TeamBuildOutDir)'=='' ">bin\release\</OutputPath>
    <OutputPath Condition=" '$(TeamBuildOUtDir)'!='' ">$(TeamBuildOutDir)\<ProjectName>\</OutputPath>

                    The word “Release|AnyCPU” is dependent on the value of “ConfigrationToBuild”  in TFSBuild.proj.        
    2.4 Save project file and check in.


    Best regards,
    Ruiz
    MSDN Subscriber Support in Forum
    If you have any feedback on our support, please contact msdnmg @ microsoft.com
    • Marked as answer by DrTissot Wednesday, June 16, 2010 2:16 PM
    Wednesday, June 16, 2010 9:59 AM
    Moderator

All replies

  • Hi Greg,

    This is because the Property OutDir.

    Each project will copy its output to OutDir. By default(like desktop build), the value of OutPut is null and it will use the value of OutputPath(\bin\debug)

    For TeamBuild, TfsBuildHost will pass OutDir as a property to MSBuild, the path is fixed for a solution, so all output will be copied to a folder. This is benefit that only one copy of a assembly will be copied to drop folder.

    To keep the output structure, you have to make TFSBuildHost not pass OutDir to MSBuild and  custom the output path of each project.

    1 Open the build process file, navigate to Compile the Project Sequence, edit the property of Run MSBuild for Project Activity.

     Set OutDir to empty (just make the testbox is empty)

    set CommandLineArguments to String.Format("/p:SkipInvalidConfigurations=true {0} /p:TeamBuildOutDir=""{1}""", MSBuildArguments, outputDirectory)

    2 Modify each project file in the solution.
    2.1 Check out project file to Edit.
    2.2 Open project file  with notepad.
    2.3  Find <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    Use following code to replace the default OutputPath Property.
    <OutputPath Condition=" '$(TeamBuildOutDir)'=='' ">bin\release\</OutputPath>
    <OutputPath Condition=" '$(TeamBuildOUtDir)'!='' ">$(TeamBuildOutDir)\<ProjectName>\</OutputPath>

                    The word “Release|AnyCPU” is dependent on the value of “ConfigrationToBuild”  in TFSBuild.proj.        
    2.4 Save project file and check in.


    Best regards,
    Ruiz
    MSDN Subscriber Support in Forum
    If you have any feedback on our support, please contact msdnmg @ microsoft.com
    • Marked as answer by DrTissot Wednesday, June 16, 2010 2:16 PM
    Wednesday, June 16, 2010 9:59 AM
    Moderator
  • Thank you,

    This is working very well, I've already seen a similar solution, but your explanation is much more clear.

    I'm still hoping that Microsoft will add a boolean somewhere in the build definition to keep original outpath ;) Looks usefull...

    Thanks again,

    Gregory

     

    Wednesday, June 16, 2010 2:20 PM
  • Hello,

    A problem following this solution is that all websites included in the solution are not publish in the "_PublishedWebsites" folder anymore.

    Greg

    Thursday, June 17, 2010 9:23 AM
  • Hello,

    A problem following this solution is that all websites included in the solution are not publish in the "_PublishedWebsites" folder anymore.

    Greg

    I'm seeing this same issue as Greg.  The outline of what to do has been the clearest that I have been able to find on the web, but I need the _PublishedWebsites folder to contain the bits for the website for zipping.

    Any clue as to why this method causes the _PublishedWebsites to no longer contain the web application?

     

    Mike

    Friday, July 09, 2010 6:09 PM
  • Any updates to this. I am seeing the same problem
    Tuesday, July 13, 2010 9:46 PM
  • Great, we have 36 projects in one solution. And we have several branches that should be build. Any one at Microsoft is willing to modify all our projects?
    Tuesday, July 20, 2010 12:21 PM
  • Hello,

    A problem following this solution is that all websites included in the solution are not publish in the "_PublishedWebsites" folder anymore.

    Greg


    I am also having this issue. How can it be fixed?
    Friday, October 01, 2010 4:24 PM
  • Hello,

    Same problem for me with website :(

    I create a bug on connect : https://connect.microsoft.com/VisualStudio/feedback/details/613840/tfs-2010-clean-drop-folder-impossible-for-website.

    Thanks,


    Atteint de JavaScriptite aiguë
    Friday, October 15, 2010 7:37 AM
    • Proposed as answer by DellBoy73 Thursday, November 25, 2010 8:38 AM
    Friday, November 12, 2010 3:20 PM
  • TFS Build output changes suggested by various people DO work. However some of them lead to newer issues such as MS Test failures etc.. I have summarized all the changes that need to be done in my BLOG here at

    http://archpulse.wordpress.com/2010/11/24/tfs-2010-customize-build-output-changes-and-ms-tests/

     

    Hope that helps..

    A

    Thursday, November 25, 2010 8:41 AM
  • There is a much better way in the link below. You can lesson the amount of managment on each project file by using common msbuild "target" files to set the OutputPath (managed code) and OutDir (C++ projects) properties. The instructions are missing key apostrophes and I've left a comment about resolving that. Ultimately what I'll be doing is creating a new WF activity to inject the import of those common msbuild target files into every project file just prior to the call of msbuild and thus avoiding having to manually insert the import statement into every project file or worse yet rely on the developers.

    http://msdn.microsoft.com/en-us/library/ff977206.aspx

    Friday, February 11, 2011 8:01 AM