"nuget restore" 在构建 azure Pipeline 时一些 lib 的问题
Problem with "nuget restore" with some lib's in build azure Pipeline
我正在使用 netcoreapp3.1 并且一切都与命令 dotnet restore 和 dotnet build 一起工作,但是在构建管道中,使用的命令是 nuget restore,这会导致以下错误:
Package Microsoft.AspNetCore.JsonPatch 3.1.1 is not compatible with netcoreapp3.1 (.NETCoreApp,Version=v3.1). Package Microsoft.AspNetCore.JsonPatch 3.1.1 supports: netstandard2.0 (.NETStandard,Version=v2.0)
Package Microsoft.Extensions.Logging.Abstractions 3.0.0 is not compatible with netcoreapp3.1 (.NETCoreApp,Version=v3.1). Package Microsoft.Extensions.Logging.Abstractions 3.0.0 supports: netstandard2.0 (.NETStandard,Version=v2.0)
Package Microsoft.Extensions.DependencyInjection.Abstractions 3.0.0 is not compatible with netcoreapp3.1 (.NETCoreApp,Version=v3.1). Package Microsoft.Extensions.DependencyInjection.Abstractions 3.0.0 supports: netstandard2.0 (.NETStandard,Version=v2.0)
One or more packages are incompatible with .NETCoreApp,Version=v3.1.
我使用了错误的代理规范,正确的是 windows-2019 我使用的是 windows-2017
在我的场景中,我必须安装 NuGet 5.4.0(随 .NET Core 3.1 一起发布)来解决这个问题
如果在 Azure DevOps 中使用 YAML 模板,您可以添加此任务:
- task: NuGetToolInstaller@1
inputs:
versionSpec: '5.4.0'
这解决了
- task: NuGetToolInstaller@1
inputs:
versionSpec: '5.x'
我正在使用 netcoreapp3.1 并且一切都与命令 dotnet restore 和 dotnet build 一起工作,但是在构建管道中,使用的命令是 nuget restore,这会导致以下错误:
Package Microsoft.AspNetCore.JsonPatch 3.1.1 is not compatible with netcoreapp3.1 (.NETCoreApp,Version=v3.1). Package Microsoft.AspNetCore.JsonPatch 3.1.1 supports: netstandard2.0 (.NETStandard,Version=v2.0)
Package Microsoft.Extensions.Logging.Abstractions 3.0.0 is not compatible with netcoreapp3.1 (.NETCoreApp,Version=v3.1). Package Microsoft.Extensions.Logging.Abstractions 3.0.0 supports: netstandard2.0 (.NETStandard,Version=v2.0)
Package Microsoft.Extensions.DependencyInjection.Abstractions 3.0.0 is not compatible with netcoreapp3.1 (.NETCoreApp,Version=v3.1). Package Microsoft.Extensions.DependencyInjection.Abstractions 3.0.0 supports: netstandard2.0 (.NETStandard,Version=v2.0)
One or more packages are incompatible with .NETCoreApp,Version=v3.1.
我使用了错误的代理规范,正确的是 windows-2019 我使用的是 windows-2017
在我的场景中,我必须安装 NuGet 5.4.0(随 .NET Core 3.1 一起发布)来解决这个问题
如果在 Azure DevOps 中使用 YAML 模板,您可以添加此任务:
- task: NuGetToolInstaller@1
inputs:
versionSpec: '5.4.0'
这解决了
- task: NuGetToolInstaller@1
inputs:
versionSpec: '5.x'