locked
TFS 2010 C++ Builds, no output in "Binaries" directory after build RRS feed

  • Question

  • My understanding is that default output directory for MSBuild is a "Binaries" directory one up from Sources in the build workspace. My builds are completing successfully but I am not getting anything in the Binaries directory, and consequently, nothing in the drop folder. I almost worked around this issue by adding a post build step in the vcproj to copy the output from the ./Release directory(output dir in the solution) to the Binaries directory. This worked fine until I turned on code analysis. Since code analysis is occurring before the post build steps it goes out to the binaries directory looking for the output and errors out because it doesn't exist. Shouldn't I be getting output in the Binaries directory without a post build step? I thought MSbuild overrides the output directory defined in the vcproj? Can I change the default output dir for MSBuild from ..\..\Binaries to .\Release to resolve this issue(and how do I do that), or is there something else I'm missing.

    Thursday, October 7, 2010 5:17 PM

Answers

  • Ok, I figured it out. Output File under Linker in the vcxproj was set to .\Release\app.exe, I changed it to: $(OutDir)$(TargetName)$(TargetExt). It appears if this is hard coded to a directory then Team Build will not override the output directory... Kind of stinks since all of our companies projects point to .\Release\*.* in the Linker, meaning I'll be making quite a few changes to get team build to work correctly.
    • Marked as answer by BlaneS Monday, October 11, 2010 7:39 PM
    Monday, October 11, 2010 7:39 PM

All replies

  • Hi BlaneS,

    Do you mean you build using Team build, the build completely successful but in your Binaries direcotry, you got nothing?

    In the build definition-> Process tab, in the Build process parameters->Advanced, Do you set the Cope Outputs to Drop Folder to True?

    You can change the default output dir from right click the Build node in the Team Explorer, select Manage Build Controllers, in the Manage Build Controllers dialog, select the agent which your build use, and click Properties, in the Working Directory, input your output directory, and click OK.

    For more information, you can refer to http://geekswithblogs.net/jakob/archive/2010/09/01/tfs-team-build-2010-how-to-place-the-build-output.aspx

    Hope it helps!

    Best Regards,

    Cathy Kong

     

    Monday, October 11, 2010 6:56 AM
    Moderator
  • Yes, Team build. "Copy Outputs to Drop Folder" is set to true. No issue with the drop location, it's the preliminary OutDir "Binaries" that is not getting written to. It is my understanding that the output of a Team Build or MSbuild is supposed to go to the "Binaries" directory at the root of the workspace first, then copied from there into the drop folder after code analysis. Since my Binaries directory is empty after a build, nothing gets copied to the drop folder(my compiled code exists in the "Release" directory as defined in the vcproj.)

    With code analysis off I tricked teambuild by adding a post-build step in the vcproj to copy the build output from Release to ../../Binaries. That was enough to get teambuild to copy the output to the drop location. This did not help with the code analysis portion.  Since code analysis takes place before post build steps, when the code analyzer runs against the Binaries directory, it finds nothing and fails the build process.

    Monday, October 11, 2010 2:46 PM
  • Ok, I figured it out. Output File under Linker in the vcxproj was set to .\Release\app.exe, I changed it to: $(OutDir)$(TargetName)$(TargetExt). It appears if this is hard coded to a directory then Team Build will not override the output directory... Kind of stinks since all of our companies projects point to .\Release\*.* in the Linker, meaning I'll be making quite a few changes to get team build to work correctly.
    • Marked as answer by BlaneS Monday, October 11, 2010 7:39 PM
    Monday, October 11, 2010 7:39 PM
  • Hi BlaneS,

    Thanks for sharing the solution, which will be benificial to other community members!

    Best Regards,

    Cathy Kong

     

    Tuesday, October 12, 2010 1:03 AM
    Moderator