0

I have create an empty project on dev.azure.com

I have cloned the repository on my local computer.

I have run this command in the main folder:

$ dotnet new mvc

I have create this azure-pipelines.yml file:

trigger:
- master

pool:
  vmImage: 'windows-latest'

steps:
- task: DotNetCoreCLI@2
  inputs:
    command: 'restore'
    feedsToUse: 'select'
- task: DotNetCoreCLI@2
  inputs:
    command: 'build'
- task: DotNetCoreCLI@2
  inputs:
    command: 'publish'
    publishWebProjects: true
- task: PublishBuildArtifacts@1
  inputs:
    PathtoPublish: '$(Build.ArtifactStagingDirectory)'
    ArtifactName: 'artifact2'

I have add, commit and pushed files on dev.azure.com (on master branch)

I have this warning message:

##[warning]Directory 'd:\a\1\a' is empty. Nothing will be added to build artifact 'artifact2'.

I have create a release pipeline but i get an error:

##[error]Error: No package found with specified pattern: D:\a\r1\a\**\*.zip<br/>Check if the package mentioned in the task is published as an artifact in the build or a previous stage and downloaded in the current job.

I do not understand what is wrong in my azure-pipelines.yml for artifact production...

Thanks

1
  • 1
    If it helped to solve your issue do not forget to upvote as well. It is different the tick - worked for you - and the upvote - it is a useful answer. Thanks Commented May 25, 2020 at 6:52

1 Answer 1

1

It seems that there is an issue where the published dlls are placed. Try the yaml below, that I have explicitly set the output directory for the published dlls and zipped the files after publish(that would probably be your next issue). I have also explicitly set in which folder to look for the published folder in order to publish the artifact.

trigger:
    - master

    pool:
      vmImage: 'windows-latest'

    steps:
    - task: DotNetCoreCLI@2
      inputs:
        command: 'restore'
        feedsToUse: 'select'
    - task: DotNetCoreCLI@2
      inputs:
        command: 'build'
    - task: DotNetCoreCLI@2
      inputs:
        command: 'publish'
        publishWebProjects: true
        modifyOutputPath: true
        arguments: '--configuration $(BuildConfiguration) --output "$(build.artifactstagingdirectory)"'
        zipAfterPublish: true
    - task: PublishBuildArtifacts@1
      inputs:
        PathtoPublish: '$(Build.ArtifactStagingDirectory)'
        ArtifactName: 'artifact2'
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.