Lara
Lara

Reputation: 51

TFS 2015 Publishing build artifacts using file share option failed

I wanted to created a demo app that does automatic deployment. In other words once I check-in my code changes, the changes can be seen on the published website. I did the following steps:

Here is the configuration for the build definition:

Build Solution Task

Copy Files to Task

Source Folder Path

Publish Artifacts Task

The folder in the file share path is shared to everyone, and the path is correct (when I type it in the browser, I can see the folder's contents).

The error I keep getting is the following:

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

I've been trying to solve this for 2 days with no luck, but I could not find similar issues... I would like to know what is causing this error, or if you have any hints or tips that will get me closer to the solution.

Upvotes: 3

Views: 3789

Answers (3)

Cece Dong - MSFT
Cece Dong - MSFT

Reputation: 31003

In your Publish Artifacts Task, you've specified //localhost/builddrop/ in File share path, which is not correct. You need to specify the File share path as below:

\\servername\builddrop

Upvotes: 1

Lara
Lara

Reputation: 51

Thanks to @Maxsur answer I realized that I did not install a build agent, which is needed for in case you want to publish your code into a file share. I did that by going to the team foundation server web portal clicked on the gear sign, and chose Agent Queues and followed the steps. Additionally you will also need to acquire a token by clicking on your profile icon then choosing security and add new token.
Reference: https://learn.microsoft.com/en-us/vsts/pipelines/agents/v2-windows?view=vsts

Upvotes: 2

Maxsur
Maxsur

Reputation: 46

Try to check (and change) an account for your build agent service. It can be found at Windows Services -> VSTS Agent on build machine (or TFS server if it used as build machine). This service can run under "local service" account, which cannot access network shares (even on local machine!). Try to change this account to Administrator (for example) or setup one by guidelines of MSDN

Upvotes: 1

Related Questions