0
votes

I got this error in release of azure pipeline

[error]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.

here is my yaml file :

trigger:
- main

pool:
  vmImage: 'windows-latest'

variables:
  buildConfiguration: 'Release'

steps:
- task: UseDotNet@2
  displayName: 'Install .NET Core SDK'
  inputs:
    version: 5.0.x
    performMultiLevelLookup: true
    includePreviewVersions: true # Required for preview versions
- task: DotNetCoreCLI@2
  inputs:
    command: 'restore'
    projects: '**/*.csproj'
  displayName: 'Restore Nuget Packages'
 
- task: DotNetCoreCLI@2
  inputs:
    command: 'build'
    projects: '**/*.csproj'
    arguments: '--no-restore'
  displayName: 'Build projects'

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

- task: PublishBuildArtifacts@1    
  displayName: 'Publish Artifact: drop'
  inputs:
    PathtoPublish: '$(build.artifactstagingdirectory)'


and iis deploy :

IIS deploy

so how can I solve this problem ?

1
can you share the logs of the build?Shayki Abramczyk

1 Answers

0
votes

I forgot to add publish command in my yaml .

updated yaml file :


trigger:
- main

pool:
  vmImage: 'windows-latest'

variables:
  buildConfiguration: 'Release'

steps:
- task: UseDotNet@2
  displayName: 'Install .NET Core SDK'
  inputs:
    version: 5.0.x
    performMultiLevelLookup: true
    includePreviewVersions: true # Required for preview versions
- task: DotNetCoreCLI@2
  inputs:
    command: 'restore'
    projects: '**/*.csproj'
  displayName: 'Restore Nuget Packages'
 
- task: DotNetCoreCLI@2
  inputs:
    command: 'build'
    projects: '**/*.csproj'
    arguments: '--no-restore'
  displayName: 'Build projects'

- task: DotNetCoreCLI@2
  inputs:
   command: 'publish'
   publishWebProjects: true
   arguments: '--configuration $(buildConfiguration) --output $(build.ArtifactStagingDirectory)'

- task: PublishBuildArtifacts@1    
  inputs:
    PathtoPublish: '$(build.artifactstagingdirectory)'
    ArtifactName: 'api.chibebinam'