Azure devops Nuget还原在.NET Core SDK 5.0.100中失败

Azure devops Nuget还原在.NET Core SDK 5.0.100中失败,azure-devops,msbuild,nuget,.net-5,Azure Devops,Msbuild,Nuget,.net 5,我刚刚更新了一个使用net50的解决方案,它在本地构建,但不在Azure管道中构建。如何指定能够构建net50项目的Azure管道代理 管道在执行nuget restore步骤时失败,出现以下错误: 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

我刚刚更新了一个使用
net50
的解决方案,它在本地构建,但不在Azure管道中构建。如何指定能够构建
net50
项目的Azure管道代理


管道在执行
nuget restore
步骤时失败,出现以下错误:

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.
我的管道yaml包括:

触发器:
-主人
游泳池:
vmImage:“windows最新版本”
变量:
buildConfiguration:“调试”
步骤:
-任务:UseDotNet@2
displayName:“使用.NET核心sdk”
投入:
packageType:sdk
版本:5.x
安装路径:$(Agent.ToolsDirectory)/dotnet
-任务:NuGetCommand@2
displayName:“nuget还原”
投入:
恢复解决方案:'***.sln'
feedsToUse:config
nugetConfigPath:'NuGet.config'

看起来图像尚未更新,16.8不可用。请检查以下内容:

我们始终使visual studio版本保持最新。但是,部署映像有时可能需要一周(或两周)


使用
NuGetCommand@2
步骤是使用
DotNetCoreCLI@2
step。如果您正在构建遗留(非SDK)项目,这可能不可行

我的YAML现在是:

触发器:
-主人
游泳池:
vmImage:“windows最新版本”
变量:
buildConfiguration:“调试”
步骤:
-任务:UseDotNet@2
displayName:“使用.NET核心sdk”
投入:
packageType:sdk
版本:5.x
安装路径:$(Agent.ToolsDirectory)/dotnet
-任务:DotNetCoreCLI@2
displayName:“dotnet还原”
投入:
命令:“还原”
项目:“***.csproj”
feedsToUse:'config'
nugetConfigPath:'nuget.config'
感谢@Krzysztof为我指明了正确的方向

FWIW,这是来自内存,使用
DotNetCoreCLI@2
对于一个
net48
项目(碰巧包含在此管道解决方案中),在
netcoreapp3.1
下失败,但似乎在
net50
下工作