I've got a .Net Core 3.1 created in Visual Studio 2019 (C# .Net Core library). I'm attempting to add EntityFrameworkCore thru NuGet package manager to the project. When attempting to add I got some compatibility errors.
So we created the projects and added EntityFrameworkCore on a different system. When attempting to build those project in Visual Studio 2019 on my system, I get the following errors:
This is a snapshot of the .Net and .NetCore runtime and sdks installed on the machine:
Here are the results from dotnet restore: (Partial Listing)
Foo.WPFApp>dotnet restore Determining projects to restore... : warning NU1701: Package 'System.ComponentModel.Annotations 5.0.0' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETCoreApp,Version=v3.1'. This package may not be fully compatible with your project. [Foo.WPFApp\Bar.WPFApp.sln] : error NU1202: Package Microsoft.EntityFrameworkCore 5.0.0 is not compatible with netcoreapp3.1 (.NETCoreApp,Version=v3.1). Package Microsoft.EntityFrameworkCore 5.0.0 does not support any target frameworks. [Foo.WPFApp\Bar.WPFApp.sln] : error NU1202: Package Microsoft.EntityFrameworkCore.Abstractions 5.0.0 is not compatible with netcoreapp3.1 (.NETCoreApp,Version=v3.1). Package Microsoft.EntityFrameworkCore.Abstractions 5.0.0 does not support any target frameworks. [Foo.WPFApp\Bar.WPFApp.sln] : error NU1202: Package Microsoft.Extensions.Caching.Memory 5.0.0 is not compatible with netcoreapp3.1 (.NETCoreApp,Version=v3.1). Package Microsoft.Extensions.Caching.Memory 5.0.0 does not support any target frameworks. [Foo.WPFApp\Bar.WPFApp.sln] : error NU1202: Package Microsoft.Extensions.DependencyInjection 5.0.0 is not compatible with netcoreapp3.1 (.NETCoreApp,Version=v3.1). Package Microsoft.Extensions.DependencyInjection 5.0.0 does not support any target frameworks. [Foo.WPFApp\Bar.WPFApp.sln] : error NU1202: Package Microsoft.Extensions.Logging 5.0.0 is not compatible with netcoreapp3.1 (.NETCoreApp,Version=v3.1). Package Microsoft.Extensions.Logging 5.0.0 does not support any target frameworks. [Foo.WPFApp\Bar.WPFApp.sln] : error NU1202: Package
Here are the results from a dotnet build: (Partial Listing)
Determining projects to restore... ....csproj : warning NU1701: Package 'System.ComponentModel.Annotations 5.0.0' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETCoreApp,Version=v3.1'. This package may not be fully compatible with your project. [Foo.WPFApp\Bar.WPFApp.sln] ....csproj : error NU1202: Package Microsoft.EntityFrameworkCore 5.0.0 is not compatible with netcoreapp3.1 (.NETCoreApp,Version=v3.1). Package Microsoft.EntityFrameworkCore 5.0.0 does not support any target frameworks. [Foo.WPFApp\Bar.WPFApp.sln] ....csproj : error NU1202: Package Microsoft.EntityFrameworkCore.Abstractions 5.0.0 is not compatible with netcoreapp3.1 (.NETCoreApp,Version=v3.1). Package Microsoft.EntityFrameworkCore.Abstractions 5.0.0 does not support any target frameworks. [Foo.WPFApp\Bar.WPFApp.sln] ....csproj : error NU1202: Package Microsoft.Extensions.Caching.Memory 5.0.0 is not compatible with netcoreapp3.1 (.NETCoreApp,Version=v3.1). Package Microsoft.Extensions.Caching.Memory 5.0.0 does not support any target frameworks. [Foo.WPFApp\Bar.WPFApp.sln] ....csproj : error NU1202: Package Microsoft.Extensions.DependencyInjection 5.0.0 is not compatible with netcoreapp3.1 (.NETCoreApp,Version=v3.1). Package Microsoft.Extensions.DependencyInjection 5.0.0 does not support any target frameworks. [Foo.WPFApp\Bar.WPFApp.sln] ....csproj : error
Can someone help me identify the issue and fix it?