4

我正在将 VS 2012 与 TFS 2012 一起使用。我正在检查一组更改,其中包括删除具有长组合路径/文件名的文件。门控构建失败:

Exception Message: TF400889: The following path contains more than the allowed 259 characters: C:\Builds\10\MFirstPartOfMyPath>\__Unmapped__\78118\<SecondPartOfMyPath>\<MyFileName>.sql. Specify a shorter path. (type InvalidPathException)
Exception Stack Trace: 
Server stack trace: 
   at Microsoft.TeamFoundation.Common.FileSpec.GetFullPathWrapper(String path)
   at Microsoft.TeamFoundation.Common.FileSpec.GetFullPath(String path, Boolean checkForIllegalDollar)
   at Microsoft.TeamFoundation.VersionControl.Client.Workspace.Map(String serverPath, String localPath)
   at Microsoft.TeamFoundation.Build.Workflow.Activities.TfWorkfold.RunCommand(VersionControlScope versionControlScope, Workspace workspace, TfWorkfoldAction action, String serverPath, String localPath)
   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink)

Exception rethrown at [0]: 
   at System.Runtime.Remoting.Proxies.RealProxy.EndInvokeHelper(Message reqMsg, Boolean bProxyCase)
   at System.Runtime.Remoting.Proxies.RemotingProxy.Invoke(Object NotUsed, MessageData& msgData)
   at System.Action`5.EndInvoke(IAsyncResult result)
   at Microsoft.TeamFoundation.Build.Workflow.Activities.TfWorkfold.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
   at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)

Inner Exception Details:

Exception Message: 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. (type PathTooLongException)
Exception Stack Trace:    at System.IO.PathHelper.GetFullPathName()
   at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength)
   at System.IO.Path.GetFullPath(String path)
   at Microsoft.TeamFoundation.Common.FileSpec.GetFullPathWrapper(String path)

如果我尝试添加这样的文件,我可以理解这一点,但签入正在尝试删除已经存在的文件。我该如何解决这个错误?

4

1 回答 1

4

诀窍是:

  1. 撤消删除
  2. 将文件重命名为更短的名称
  3. 签入(触发构建)
  4. 获取最新信息
  5. 删除文件
  6. 报到
于 2013-07-24T14:25:00.243 回答