0
votes

I use ASP.NET core , and i am building a pipeline in Azure DevOps. The build is successful. but in the release error says:

[error]Error: No package found with specified pattern: D:\a\r1\a***.zip

I have tried to add these in build pipeline:

- task: PublishBuildArtifacts@1

But got this warning there:

[warning]Directory '/home/vsts/work/1/a' is empty. Nothing will be added to build artifact 'drop'.

My Build yaml looks this way:

trigger:
- master

pool:
  vmImage: 'Ubuntu-16.04'

variables:
  buildConfiguration: 'Release'

steps:
- script: dotnet build --configuration $(buildConfiguration)
  displayName: 'dotnet build $(buildConfiguration)'

- task: PublishBuildArtifacts@1
1
is this the complete yaml from your build ? you just build something but don't copy it to the $(build.artifactsstagingdirectory)D.J.
Just checking in to see if the information provided was helpful. Please let us know if you would like further assistance.Leo Liu-MSFT

1 Answers

0
votes

Asp.net core application, ##[error]Error: No package found with specified pattern: D:\a\r1\a***.zip i get this error

Just as D.J said, you should add another task Copy Files task before the task PublishBuildArtifacts.

As the state of the task Publish Build Artifacts task:

Use this task in a build pipeline to publish build artifacts to Azure Pipelines, TFS, or a file share.

But the output of the build task is not automatically copied to the build artifacts, so we need a copy task to copy it to the build artifacts:

- task: CopyFiles@2
  inputs:
    contents: '_buildOutput\**'
    targetFolder: $(Build.ArtifactStagingDirectory)
- task: PublishBuildArtifacts@1
  inputs:
    pathtoPublish: $(Build.ArtifactStagingDirectory)
    artifactName: MyBuildOutputs

Note: Pay attention to check the syntax of Arguments Contents in the copy file task.

Hope this helps.