Search code examples
visual-studiotfsazure-devopstfsbuildazure-pipelines

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:

  • I created an .NET project on Visual Studio 2017, published the project with IIS instructions from here and here. I published my project to a local file on my machine;
  • The I did Continuous Delivery and Release Management using TFS 2015 and created a build and release definitions from here;
  • The final step was to use the Copy File to and Publish Artifacts tasks, using file share option to drop the contents to the publish folder I've created. So when I check-in my changes using TFS, the changes will be seen online.

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.


Solution

  • 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