Visual Studio Team Services Release/Deploy fails - “No package found with specified pattern”

前端 未结 5 1589
轮回少年
轮回少年 2021-02-12 13:50

I\'m trying to implement continuous integration and continuous deployment to my DEV Azure App Service. I\'m using the hosted agent on Visual Studio Team Services. The \"Deploy W

5条回答
  •  礼貌的吻别
    2021-02-12 14:09

    if you are using the default azure app service deployment task, add this to end of YAML file:

    - task: DotNetCoreCLI@2
      displayName: 'dotnet publish $(buildConfiguration)'
      inputs:
        command: publish
        publishWebProjects: True
        arguments: '--configuration $(buildConfiguration) --output $(Build.ArtifactStagingDirectory)'
        zipAfterPublish: True
    
    - task: PublishBuildArtifacts@1
      displayName: 'publish artifacts'
    

    I had the same issue and this worked for me:

    # 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:
    - master
    
    pool:
      vmImage: 'ubuntu-latest'
    
    variables:
      buildConfiguration: 'Release'
    
    steps:
    - script: dotnet build --configuration $(buildConfiguration)
      displayName: 'dotnet build $(buildConfiguration)'
    
    - task: DotNetCoreCLI@2
      displayName: 'dotnet publish $(buildConfiguration)'
      inputs:
        command: publish
        publishWebProjects: True
        arguments: '--configuration $(buildConfiguration) --output $(Build.ArtifactStagingDirectory)'
        zipAfterPublish: True
    
    - task: PublishBuildArtifacts@1
      displayName: 'publish artifacts'
    

提交回复
热议问题