TFS Build error - "The specified path, file name, or both are too long..."

Hoang Nguyen picture Hoang Nguyen · Jan 20, 2014 · Viewed 10.5k times · Source

I'm writing the Custom Activities of build process template. I got the below issue when build the activity.

>XamlBuildTask : error XC1043: Extension 'Microsoft.Activities.Build.BeforeInitializeComponentExtension' threw an exception of type 'System.IO.PathTooLongException' :  '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.'.

Do you have any ideas? Please help!

Answer

Nam G VU picture Nam G VU · Jan 20, 2014

I find one tip here. Hope it might be helpful to you.

Currently there are a two workarounds:

Reduce the namespace in workflow x:Class property. This makes the generated file have a shorter name.

Use the subst or mklink command to create mapping so that the path the solution is located in becomes a lot smaller. In team build, the workspace mapping needs to be modified equally.