C# “问题”;nuget restore“;使用一些lib';s正在构建azure管道
我使用的是netcoreapp3.1,所有操作都与命令dotnet restore和dotnet build配合使用,但在构建管道中,使用的命令是nuget restore,这会导致以下错误:C# “问题”;nuget restore“;使用一些lib';s正在构建azure管道,c#,azure,.net-core-3.1,C#,Azure,.net Core 3.1,我使用的是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
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模板,则可以添加此任务:
-任务:NuGetToolInstaller@1
投入:
版本规范:“5.4.0”
此问题已解决
- task: NuGetToolInstaller@1
inputs:
versionSpec: '5.x'
副本