.net core VST上的Nuget还原版本冲突生成错误

.net core VST上的Nuget还原版本冲突生成错误,.net-core,azure-pipelines,nuget-package-restore,azure-pipelines-build-task,.net Core,Azure Pipelines,Nuget Package Restore,Azure Pipelines Build Task,本地生成很好,但在VSTS生成服务器上出现以下错误。问题很清楚,但无法解决 018-07-18T19:41:24.6993903Z ##[error]The nuget command failed with exit code(1) and error(NU1107: Version conflict detected for Microsoft.AspNetCore.Http.Abstractions. Reference the package directly from the proj

本地生成很好,但在VSTS生成服务器上出现以下错误。问题很清楚,但无法解决

018-07-18T19:41:24.6993903Z ##[error]The nuget command failed with exit code(1) and error(NU1107: Version conflict detected for Microsoft.AspNetCore.Http.Abstractions. Reference the package directly from the project to resolve this issue. 
 webapi.admin -> Microsoft.AspNetCore.Cors 2.1.1 -> Microsoft.AspNetCore.Http.Extensions 2.1.1 -> Microsoft.AspNetCore.Http.Abstractions (>= 2.1.1) 
 webapi.admin -> Microsoft.AspNetCore.App 2.1.0 -> Microsoft.AspNetCore.Http.Abstractions (= 2.1.0).

能否将Microsoft.AspNetCore.App升级到2.1.1版

还是将所有nuget引用升级到最新版本?(2.1.2针对这些)


对于本地工作的构建,请尝试清理,或创建源代码管理repo的新克隆,看看是否有效。

明确设置版本属性解决了它,更改:


这里有更多详细信息:

我也在处理这些问题,但这是因为我只是从其他地方复制了一个部署YAML文件,没有使用正确的工具。在完成本教程之后,它的效果非常出色:

更具体地说,我认为使用dotnet还原来还原您的包可能会解决这个问题:

steps:
- script: dotnet restore
还要确保安装正确的.NET Core SDK

steps:
- task: DotNetCoreInstaller@0
  inputs:
    version: '2.1.300' # replace this value with the version that you need for your project
解决使用。通过添加版本属性更改为。