Azure CI pipeline for Blazor .NET 5 doesn't work

后端 未结 2 971
难免孤独
难免孤独 2020-12-20 20:46

I have an existing Azure CI pipeline for a WebAssembly Blazor application, that works with .NET Core 3.1.

I upgraded the application to use .NET 5 RC, and the pipelin

2条回答
  •  独厮守ぢ
    2020-12-20 21:09

    Change your UseDotNet task to the following in order to make sure that the Visual Studio 2019 preview is used in conjunction with .NET5 preview:

    - 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
    

    Full YAML pipeline for your reference (this is working for my Blazor WASM .Net 5 project):

    pool:
      vmImage: 'ubuntu-latest'
    
    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
      displayName: 'NuGet restore'
      inputs:
        command: 'restore'
        projects: 'MyProject/MyProject.csproj'
        verbosityRestore: 'Normal'
    
    - task: DotNetCoreCLI@2
      displayName: 'Build'
      inputs:
        zipAfterPublish: true
        command: publish
        publishWebProjects: false
        projects: 'MyProject/MyProject.csproj'
        arguments: '-c $(Build.Configuration) -o $(Build.ArtifactStagingDirectory) --no-restore'
    
    - task: PublishBuildArtifacts@1
      displayName: 'Publish'
      inputs:
        PathtoPublish: '$(Build.ArtifactStagingDirectory)'
        ArtifactName: 'drop'
        publishLocation: 'Container'
    

提交回复
热议问题