Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VSTS: Directory 'd:\a\1\a' is empty. Nothing will be added to build artifact 'drop'

I am making my first build in VSTS and I have had to ask a number of questions on SO. I have now been able to restore nuget packages and build my project but now I have to ensure the artifacts are copied to the right place. My last build attempt failed for this reason: Directory 'd:\a\1\a' is empty. Nothing will be added to build artifact 'drop'. My build is defined as; enter image description here

The Copy Files enter image description here

The .Net Core build; enter image description here

And the publish; enter image description here

And from the build I get this error;

Directory 'd:\a\1\a' is empty. Nothing will be added to build artifact 'drop'.

How do I fix this?

like image 572
arame3333 Avatar asked May 24 '17 08:05

arame3333


3 Answers

You need to copy and add artifact, so for me I had to add this code to the end of my .yaml file

- task: CopyFiles@2
  inputs:
    targetFolder: '$(Build.ArtifactStagingDirectory)'    

- task: PublishBuildArtifacts@1    
  displayName: 'Publish Artifact: drop'
  inputs:
    PathtoPublish: '$(build.artifactstagingdirectory)'
like image 132
Ehsan Zargar Ershadi Avatar answered Oct 19 '22 05:10

Ehsan Zargar Ershadi


First, remove ";" before Properties.EF6 (/t:;Properties.EF6;Sir.Domain).

Note: If Sir.WebUI dependency on Properties.EF6, Sir.Domain, Sir.EF6 and StandardClassLibrary, you just need to build Sir.WebUI project.

Secondly, for .Net Core task, change build command to publish and arguments is -o $(build.artifactstagingdirectory)\SIR.

Thirdly, remove Copy Files task (do not need to copy files to artifact).

like image 38
starian chen-MSFT Avatar answered Oct 19 '22 06:10

starian chen-MSFT


The default build arguments don't work if you plan to use the release pipeline in azure devops.

Using the following to the MS BuildArguments in the Build step drops a package in the staging directory: $(build.artifactstagingdirectory).

/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactstagingdirectory)\\"

In the Publish Artifact step use the same location as the value:

$(build.artifactstagingdirectory)
like image 3
StevieROF Avatar answered Oct 19 '22 06:10

StevieROF