Azure CI pipeline for Blazor .NET 5 doesn't work
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'