TFS 2015 U1 vNext build 发布工件总是失败,无法将工件与资源关联

TFS 2015 U1 vNext build Publish Artifact always fails with Unable to associate artifact with resource

在尝试使用 Publish Artifact 任务执行任何 vNext 构建时,我们最终收到以下错误

##[error]Unable to associate artifact with resource at location:[location]

示例日志输出

1 
2016-01-21T19:29:49.9838278Z Executing the powershell script: D:\Agent\tasks\PublishBuildArtifacts.0.4\PublishBuildArtifacts.ps1

2 
2016-01-21T19:29:50.1713333Z Preparing artifact content in staging folder D:\Agent\_work\a...

3 
2016-01-21T19:29:50.2338323Z Copying all files from D:\Agent\_work\s\ASC\ASC-Dev\CSDChangeControlDispatcher to D:\Agent\_work\a\CSDChangeControlDispatcher\CSDChangeControlDispatcher

4 
2016-01-21T19:29:50.4838343Z Copying all files from D:\Agent\_work\s\ASC\ASC-Dev\PrecompiledWeb\CSDChangeControlDispatcher to D:\Agent\_work\a\CSDChangeControlDispatcher\PrecompiledWeb\CSDChangeControlDispatcher

5 
2016-01-21T19:29:50.5150903Z Copying artifact content to D:\BuildDrop\ASC Dev vNext160121.7...

6 
2016-01-21T19:29:50.9369728Z Start: AssociateArtifact

7 
2016-01-21T19:29:50.9369728Z ##[error]Unable to associate artifact with resource at location:D:\BuildDrop\ASC Dev vNext160121.7.

8 
2016-01-21T19:29:50.9369728Z End: AssociateArtifact

问题是您将发布工件的路径指定为 "D:\BuildDrop\ASC Dev vNext160121.7"。

您应该在路径项中使用“\ \ my\share”而不是绝对路径。

如果路径中包含带括号的文件夹名称,您也会收到此错误。例如 \\servername\afolder\[文件夹名].