TFS Build "Workspace already mapped" Issue
If you are creating multiple build types, i.e. daily, weekly, continuous and others for a Team Project, you may have ... with all likelihood ... encountered the "workspace already mapped" and "path too long" issues using defaults when completing the TFS Build wizard and not giving the working directory much thought. There are a number of good blog posts available that discuss this topic in more detail, i.e. http://forums.microsoft.com/msdn/ShowPost.aspx?PostID=3554768&SiteID=1 and http://blogs.msdn.com/aaronhallberg/archive/2007/06/20/team-build-and-260-character-paths.aspx and colleagues such as Martin and Grant cover the TSF Build extensively on their blogs as well.
Basically the recommendations include the following considerations when defining a Team Build:
- Keep your working directory as short as possible, because the length of filenames, made up of the working directory and the solution paths quickly consume the 260 available characters.
- Include $(BuildDefinitionPath) and/or $(BuildDefinitionID) in the build directory path for the build agent, using the following template:
Some examples:
- c:\i\$(BuildDefinitionID)
- c:\i\$(BuildDefinitionPath)
or using the default of:
- $(Temp)\$(BuildDefinitionPath)
The resultant structure on the build agent could then look similar to:
The above examples will create a flood of critique due to not being meaningful, however, the short meaningless directory name is used to try to ensure that the path remains < 260.
Have I mentioned that a book on Team Build, covering all its mysteries, challenges, best practice and power is a gem we have been waiting for for a long, long time ... ping, ping ... in the interim Bucks blog post TFS 2008: A basic guide to Team Build 2008 is a "must read" when working with Team Build.