Tag Archives: TFS2010

260 characters limitation for TFS Build Path

I created new build definition and had following error message when I tried to build.

error MSB4023: Cannot evaluate the item metadata “%(FullPath)”. The item metadata “%(FullPath)” cannot be applied to the path “”

Looking at it closely found that TFS Build has limitation of handling path length of up to 260 characters.

Presently I renamed my build definition such that it brings physical path to just under 260 characters.
Ideally source code file names will not be so long that it will make full path longer than 260 characters. However, it may not be possible at a particular point in time of project.

TFS Build Process Definition WriteLine Task

I needed to use one of the primitive task, WriteLine, that is available for TFS Build Process Definition.

My aim was to create a file with version information gets written a file in output directory of the build.

WriteLine task has following two properties that are needed to be set:


WriteLine.Text = "Text to be written by this task"
WriteLine.TextWriter = "TextWriter object that will write the text"

It is pretty simple task to use. However, I could not get anything written to the file. I could see file being created. I set following values to these properties:


WriteLine.Text = "Sample text to be written to file"
WriteLine.TextWriter = New StreamWriter(outputDirectory + "\sampletextfile.txt")

As simple as it appears, it did not work for me. However after I set StreamWriter.AutoFlush property to true and Append = false, it worked just fine.

It could be that WriteLine task handles writing to the stream differently.

I set following value to WriteLine.TextWriter property and it worked FINE.


New StreamWriter(outputDirectory + "\sampletextfile.txt", False) With {.AutoFlush = True}