Azure DevOps pipeline release Error: No package found with specified pattern:

Viewed 117

I have an ASP.NET Core project in Azure DevOps repository and it gets built OK using the DevOps build pipeline. However, the release over that builds always fails with this error:

No package found with specified pattern.
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.

More Details:

Here you can see the error

# ASP.NET Core
# Build and test ASP.NET Core projects targeting .NET Core.
# Add steps that run tests, create a NuGet package, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core

trigger:
 branches:
   include:
   - release/*

pool:
  vmImage: 'windows-2022'

variables:
  solution: '**/*.sln'
  buildPlatform: 'Any CPU'
  buildConfiguration: 'Release'
  projectName: '**/F11.Web.csproj'
  runtime: 'win-x64'

steps:
- task: UseDotNet@2
  displayName: 'Use .NET 5 SDK (preview)'
  inputs:
    packageType: 'sdk'
    version: '5.0.100-rc.1.20452.10'
    vsVersion: '16.8.0'
    includePreviewVersions: true

- task: DotNetCoreCLI@2
  inputs:
    command: 'restore'
    projects: '$(projectName)'
    feedsToUse: 'select'

- task: DotNetCoreCLI@2
  displayName: Build
  inputs:
    projects: '$(projectName)'
    arguments: '--no-restore'

- task: DotNetCoreCLI@2
  displayName: Test
  inputs:
    command: test
    projects: '$(projectName)'
    arguments: '-l "console;verbosity=detailed"'

- task: DotNetCoreCLI@2
  displayName: 'Publish WebApi'
  inputs:
    command: publish
    publishWebProjects: false
    projects: '$(projectName)'
    arguments: '--configuration $(BuildConfiguration) --output $(Build.ArtifactStagingDirectory) --runtime -r $(runtime)'

- task: CopyFiles@2
  inputs:
    Contents: '**'
    TargetFolder: '$(Build.ArtifactStagingDirectory)'
- task: PublishPipelineArtifact@1
  inputs:
    targetPath: '$(Pipeline.Workspace)' 
    artifactName:  'PublishBuildArtifact'

App Manage Config Web App Deploy

1 Answers

Azure DevOps pipeline release Error: No package found with specified pattern:

First, you could make sure you have generated the artifact for your build pipeline, check it from the build history in the build pipeline.

Second, when you using the release pipeline to deploy the artifact, you need make sure you have select the correct build pipeline.

Third, set the correct configuration for the task IIS web app deploy:

enter image description here

If above not help you, please share the configuration for the task IIS web app deploy with image in your question.

Related