title: How do I change the build directory that MSBuild uses under Team Foundation Build?
body: <p>I'm getting the following error when trying to build my app using Team Foundation Build:</p>
  
  <blockquote>
    <p>C:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets(1682,9): error MSB3554: Cannot write to the output file "obj\Release\Company.Redacted.BlahBlah.Localization.Subsystems.
    Startup_Shutdown_Processing.StartupShutdownProcessingMessages.de.resources". The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.</p>
  </blockquote>
  
  <p>My project builds fine on my development machine as the source is only two folders deep, but TF Build seems to use a really deep directory that is causing it to break. How do I change the folders that are used?</p>
  
  <p><strong>Edit:</strong> I checked the .proj file for my build that is stored in source control and found the following:</p>
  
  <pre><code>&lt;!--  BUILD DIRECTORY
   This property is included only for backwards compatibility. The build directory used for a build 
   definition is now stored in the database, as the BuildDirectory property of the definition's 
   DefaultBuildAgent. For compatibility with V1 clients, keep this property in sync with the value 
   in the database.
  --&gt;
  &lt;BuildDirectoryPath&gt;UNKNOWN&lt;/BuildDirectoryPath&gt;
  </code></pre>
  
  <p>If this is stored in the database how do I change it?</p>
  
  <p><strong>Edit:</strong> Found the following blog post which may be pointing me torward the solution. Now I just need to figure out how to change the setting in the Build Agent.  <a href="http://blogs.msdn.com/jpricket/archive/2007/04/30/build-type-builddirectorypath-build-agent-working-directory.aspx" rel="noreferrer">http://blogs.msdn.com/jpricket/archive/2007/04/30/build-type-builddirectorypath-build-agent-working-directory.aspx</a></p>
  
  <p>Currently my working directory is "$(Temp)\$(BuildDefinitionPath)" but now I don't know what wildcards are available to specify a different folder.</p>