File Path of greater than 260 characters with TFS Automated builds

Posted: May 1, 2014  |  Categories: TFS Uncategorized
Working with TFS automated builds for BizTalk I have started to run into the TFS / MSBuild file path length restrictions (no, I don’t understand in modern operating system why the build process has a file path limit) and have tried several ways to reduce the path length, with varying degrees of success, this week I discovered one way to help reduce the path length without compromising the TFS Automated build process and I would like to share it with you.

Example of the default location for the source on a build server, I have highlighted one of the longer examples:


In the TFS build Agent there is a variable that controls the start of the source location on the build server, it is called Working Directory


The default value for this is:


In the build server I have this is:


The last part of this is the source tree path and the name of the build, which are typically much longer than this example.

To reduce this I found that we can change $(BuildDefinitionPath) to $(BuildDefinitionId)


This changes the starting path to:


This is reduce the path by 13 characters, but if your source tree path and build definition name are a typical size this may reduce the path by almost 100 characters, without compromising any part of the build process.

The previous list of files now looks like this:


I hope this tip helps solve your automated build path lengths issues.

BizTalk Server

Over 650+ customers across
30+ countries depend on BizTalk360

Learn More

Operate efficiently with enterprise-grade Azure monitoring,
tracing, remediation & governance in one platform

Learn More

Back to Top