I have a solution with several .NET Standard 2.0, .NET Standard 2.1, .NET Core 3.0, and full .NET Framework 4.8 projects. The pipeline looks like this:
pool:
name: Azure Pipelines
demands:
- msbuild
- visualstudio
variables:
BuildPlatform: 'any cpu'
BuildConfiguration: 'release'
steps:
- task: UseDotNet@2
displayName: 'Use .NET Core sdk 3.0'
inputs:
version: 3.0.100
- task: DotNetCoreCLI@2
displayName: 'dotnet restore'
inputs:
command: restore
projects: '**/*.csproj'
- task: NuGetToolInstaller@1
displayName: 'Use NuGet 4.9.1'
inputs:
versionSpec: 4.9.1
checkLatest: true
- task: NuGetCommand@2
displayName: 'NuGet restore'
- task: VSBuild@1
displayName: 'Build solution **\*.sln'
inputs:
vsVersion: 16.0
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
clean: true
- task: DotNetCoreCLI@2
displayName: 'dotnet test'
inputs:
command: test
projects: '**/*tests.csproj'
- task: PublishSymbols@2
displayName: 'Publish symbols path'
inputs:
PublishSymbols: false
After installing the correct SDK version, the pipeline runs dotnet restore
to download all NuGet packages used by the .NET Standard and .NET Core projects. After that, it installs NuGet and uses it to restore the NuGet packages used by the full .NET Framework projects.
After migrating to .NET Core 3.0, however, the NuGet restore fails with the following error:
[error] The nuget command failed with exit code(1) and error(NU1202: Package Microsoft.EntityFrameworkCore.SqlServer 3.0.0 is not compatible with netcoreapp3.0 (.NETCoreApp,Version=v3.0). Package Microsoft.EntityFrameworkCore.SqlServer 3.0.0 supports: netstandard2.1 (.NETStandard,Version=v2.1)
NU1202: Package Microsoft.EntityFrameworkCore.Tools 3.0.0 is not compatible with netcoreapp3.0 (.NETCoreApp,Version=v3.0). Package Microsoft.EntityFrameworkCore.Tools 3.0.0 supports: netstandard2.1 (.NETStandard,Version=v2.1) NU1202: Package Microsoft.EntityFrameworkCore.Relational 3.0.0 is not compatible with netcoreapp3.0 (.NETCoreApp,Version=v3.0). Package Microsoft.EntityFrameworkCore.Relational 3.0.0 supports: netstandard2.1 (.NETStandard,Version=v2.1) Errors in d:\a\1\s\Pagesp.ChaveMovel.AspNetCore.Site.Identity.v2\Pagesp.ChaveMovel.AspNetCore.Site.Identity.v2.csproj NU1202: Package Microsoft.EntityFrameworkCore.SqlServer 3.0.0 is not compatible with netcoreapp3.0 (.NETCoreApp,Version=v3.0). Package Microsoft.EntityFrameworkCore.SqlServer 3.0.0 supports: netstandard2.1 (.NETStandard,Version=v2.1) NU1202: Package Microsoft.EntityFrameworkCore.Tools 3.0.0 is not compatible with netcoreapp3.0 (.NETCoreApp,Version=v3.0). Package Microsoft.EntityFrameworkCore.Tools 3.0.0 supports: netstandard2.1 (.NETStandard,Version=v2.1) NU1202: Package Microsoft.EntityFrameworkCore.Relational 3.0.0 is not compatible with netcoreapp3.0 (.NETCoreApp,Version=v3.0). Package Microsoft.EntityFrameworkCore.Relational 3.0.0 supports: netstandard2.1 (.NETStandard,Version=v2.1))
[error] Packages failed to restore
Any ideas on how to solve this?