I just updated a solution to use net50, and it builds locally, but does not build in an Azure pipeline. How do I specify an Azure pipeline agent capable of building net50 projects?
The pipeline fails on the nuget restore step with the following error:
The nuget command failed with exit code(1) and error([***].csproj : error :
Version 5.0.100 of the .NET Core SDK requires at least version 16.8.0 of MSBuild.
The current available version of MSBuild is 16.7.0.37604.
Change the .NET Core SDK specified in global.json to an older version that requires the MSBuild version currently available.
My pipeline yaml includes:
trigger:
- master
pool:
vmImage: 'windows-latest'
variables:
buildConfiguration: 'Debug'
steps:
- task: UseDotNet@2
displayName: 'Use .NET Core sdk'
inputs:
packageType: sdk
version: 5.x
installationPath: $(Agent.ToolsDirectory)/dotnet
- task: NuGetCommand@2
displayName: 'nuget restore'
inputs:
restoreSolution: '**/*.sln'
feedsToUse: config
nugetConfigPath: 'NuGet.config'