TFS 2015 使用文件共享选项发布构建工件失败

TFS 2015 Publishing build artifacts using file share option failed

我想创建一个自动部署的演示应用程序。换句话说,一旦我签入我的代码更改,就可以在发布的网站上看到这些更改。我做了以下步骤:

这里是构建定义的配置:

文件分享路径中的文件夹已分享给大家,路径正确(我在浏览器输入时可以看到文件夹内容)。

我不断收到的错误如下:

Publishing build artifacts failed with an error: Unable to create directory '{p}'. Unable to verify the directory exists: '{testDir}'. If directory is a file share, please verify the share name is correct, the share is online, and the current process has permission to access the share. \localhost\builddrop\drop \localhost\builddrop\drop

我已经尝试解决这个问题 2 天了,但没有成功,但我找不到类似的问题......我想知道是什么导致了这个错误,或者你是否有任何提示或提示会让我更接近解决方案。

尝试检查(并更改)您的构建代理服务的帐户。 它可以在构建机器上的 Windows 服务 -> VSTS 代理中找到(如果用作构建机器,则为 TFS 服务器)。 此服务可以在 "local service" 帐户下 运行,该帐户无法访问网络共享(即使在本地计算机上!)。 尝试将此帐户更改为管理员(例如)或按照 MSDN

的指南设置一个

在您的 Publish Artifacts Task 中,您在 File share path 中指定了 //localhost/builddrop/,这是不正确的。您需要指定 File share path 如下:

\servername\builddrop

感谢@Maxsur 的回答,我意识到我没有安装构建代理,如果您想将代码发布到文件共享中,则需要它。 我通过转到团队基础服务器 Web 门户单击齿轮符号,然后选择代理队列并按照步骤操作来做到这一点。此外,您还需要通过单击个人资料图标然后选择安全并添加新令牌来获取令牌。
参考:https://docs.microsoft.com/en-us/vsts/pipelines/agents/v2-windows?view=vsts