Reputation: 55
I am using netcoreapp3.1 and everything works with the command dotnet restore and dotnet build, but in the build pipeline, the command used is nuget restore, and this causes the following errors:
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.
Upvotes: 3
Views: 1927
Reputation: 1
this solved
- task: NuGetToolInstaller@1
inputs:
versionSpec: '5.x'
Upvotes: -1
Reputation: 270
In my scenario, I had to install NuGet 5.4.0 (released with .NET Core 3.1) to fix this
If using YAML templates in Azure DevOps you can add this task:
- task: NuGetToolInstaller@1
inputs:
versionSpec: '5.4.0'
Upvotes: 5
Reputation: 55
I was using the wrong Agent Specification, the correct would be windows-2019 I was using windows-2017
Upvotes: 2