Geeks With Blogs
Daniel Schroeder Sharing my tips and tricks to help other developers be more productive. This blog has moved to http://blog.danskingdom.com

Arrggghhhh TFS and builds!  Such a love-hate relationship!  So we have our TFS builds setup to both compile our C# projects as well as compile and deploy our Team Foundation (TF) Database (DB) projects.  One day I started getting the following file path too long error message on our build server:

$/RQ4TeamProject/Prototypes/BuildProcessTests/RQ4.Database.sln - 1 error(s), 69 warning(s), View Log File
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\TeamData\Microsoft.Data.Schema.TSqlTasks.targets (80): The "SqlSetupDeployTask" task failed unexpectedly. Microsoft.Data.Schema.Build.BuildFailedException: 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. ---> 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.    at System.IO.PathHelper.Append(Char value)    at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength)    at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath)    at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)    at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)    at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize)    at System.IO.StreamReader..ctor(String path, Boolean detectEncodingFromByteOrderMarks)    at Microsoft.Data.Schema.Sql.Build.SqlPrePostDeploymentModifier.GenerateMergedSqlCmdFiles(DeploymentContributorConfigurationSetup setup, DeploymentContributorConfigurationFile configFile)    at Microsoft.Data.Schema.Sql.Build.SqlPrePostDeploymentModifier.OnEstablishDeploymentConfiguration(DeploymentContributorConfigurationSetup setup)    at Microsoft.Data.Schema.Build.DeploymentContributor.EstablishDeploymentConfiguration(DeploymentContributorConfigurationSetup setup)    --- End of inner exception stack trace ---    at Microsoft.Data.Schema.Build.DeploymentContributor.EstablishDeploymentConfiguration(DeploymentContributorConfigurationSetup setup)    at Microsoft.Data.Schema.Build.DeploymentProjectBuilder.VerifyConfiguration()    at Microsoft.Data.Schema.Tasks.DBSetupDeployTask.BuildDeploymentProject(ErrorManager errors, ExtensionManager em)    at Microsoft.Data.Schema.Tasks.DBSetupDeployTask.Execute()    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()    at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask, Boolean& taskResult)

Read more at http://blog.danskingdom.com/path-too-long-for-team-foundation-database-project-build/

Posted on Sunday, February 5, 2012 10:43 AM | Back to top


Comments on this post: Path Too Long for Team Foundation Database Project Build

# re: Path Too Long for Team Foundation Database Project Build
Requesting Gravatar...
This is a Windows* OS/file system issue.The cause is directory paths on the drive is longer than 255 characters (including spaces).There's a lot of additional softwares which can fix this problem like Long Path Tool.
http://PathTooDeep.com
Long Path Tool can simplify and probably end your problems in unlocking, managing and renaming files that appear to have a long filename. Since in some instances, you may have experienced problems accessing, managing and even renaming files that have more than 255 characters, this utility has been made to answer this particular scenario. If you have also encountered problems like error messages that tell you that the path too long, too long path, destination path too long or cannot delete file then this program is definitely for you. This will totally take place of Windows Explorer, Far Manager or other file managing utilities since this is maybe used in any type of Operating System even the earliest Windows 95 version.
Left by GabrielNar89 on Nov 19, 2012 9:40 AM

# re: Path Too Long for Team Foundation Database Project Build
Requesting Gravatar...
Long path tool is the best solution for your problem. try it and solve your problem.
Left by franklo on Jun 20, 2013 8:09 AM

# re: Path Too Long for Team Foundation Database Project Build
Requesting Gravatar...
I just download and use "Long Path Tool" guarantees to fix your error fast and easy. Try it.
Left by garrydam on Aug 28, 2013 11:04 AM

# re: Path Too Long for Team Foundation Database Project Build
Requesting Gravatar...
Try to use Long Path tool program.
Left by kevin15 on Sep 30, 2015 5:16 AM

Your comment:
 (will show your gravatar)


Copyright © deadlydog | Powered by: GeeksWithBlogs.net