title: TFS2010 solutions PostBuild macro values differ in Team build
body: <p>I have a PRISM app in a single TFS solution (shell, comon library, two modules and several test projets. for simplcity I chose a DirectoryModuleCatalog and in order to run apps locally after a build added a postbuild step to teh module projects buils that copied the build dll to a modules subfolder of the GUI apps output path.</p>
  
  <p>This works just fine on a local client build, but when the same postbuild event is triggered from the TFS build agent it fails. On inspection this is becuase the $(OutDir) macro which is a relative path locally is an absolute path in teh TFS build agent MSBuild logs!</p>
  
  <p>to quote MSDN </p>
  
  <pre><code>$(OutDir) 
  
  Path to the output file directory, relative to the project directory. 
  This resolves to the value for the Output Directory property. 
  It includes the trailing backslash '\'.
  </code></pre>
  
  <p>Locally this resolves to "bin\Debug\"
  on the build agent it resolves to "C:\Builds\5\XXXX\Gui.DEV_XXXX7_Iteration0.CI\Binaries\"</p>
  
  <p>Given this orginal local post build definition;</p>
  
  <pre><code>mkdir "$(SolutionDir)Gui\$(OutDir)Modules\"
  copy "$(TargetPath)" "$(SolutionDir)Gui\$(OutDir)Modules\"
  </code></pre>
  
  <p>You can see why it fails on the build agent like this:</p>
  
  <pre><code>mkdir "C:\Builds\4\XXXX\Gui.DEV_Cortex7_Iteration0.CI\Sources\Gui\C:\Builds\4    \XXXX\Gui.DEV_XXXX7_Iteration0.CI\Binaries\Modules\"
  copy "C:\Builds\4\XXXX\Gui.DEV_XXXX7_Iteration0.CI\Binaries\Apdcomms.Cortex.Gui.Example2.Module.dll" 
      "C:\Builds\4\XXXX\Gui.DEV_XXXX7_Iteration0.CI\Sources\Gui\C:\Builds\4\XXXX\Gui.DEV_XXXX7_Iteration0.CI\Binaries\Modules\"
  The filename, directory name, or volume label syntax is incorrect.
  The filename, directory name, or volume label syntax is incorrect.
        0 file(s) copied.
  </code></pre>
  
  <p>So looing at the values of the macros it would seem I need a different set of commands in postbuild when building under TFS build agents to that in local mode, that is pretty sucky.</p>
  
  <p>SO to the qestion: <strong>How can I move the binary output of one project in a solution to a sub-folder of another project in that same solution in a way that works on a locla client build AND a TFS team build</strong>?</p>