Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Package 'Microsoft.EntityFrameworkCore.SqlServer' is incompatible with 'all' frameworks in the project

I was trying to add the package named Microsoft.EntityFrameworkCore.SqlServer by running the command.

dotnet add package Microsoft.EntityFrameworkCore.SqlServer

in Visual Studio Code, but I get this error:

Package Microsoft.EntityFrameworkCore.SqlServer 2.0.0 is not compatible with netcoreapp1.1 (.NETCoreApp,Version=v1.1). Package Microsoft.EntityFrameworkCore.SqlServer 2.0.0 supports: netstandard2.0" (.NETStandard,Version=v2.0). Package 'Microsoft.EntityFrameworkCore.SqlServer' is incompatible with 'all' frameworks in project 'C:\users\username..'

like image 795
Krishna Avatar asked Aug 16 '17 01:08

Krishna


2 Answers

In order to use version 2.0.0 of EF Core, you need the .NET Core 2.0 SDK and/or Visual Studio 2017 version 15.3.

like image 143
bricelam Avatar answered Nov 03 '22 03:11

bricelam


This Might Be Happening due to generated NuGet Cache While Installing Packages. Go to Tools>Options>NuGet Package Manager>General and "Clear All NuGet Cache". This Worked in my case(VS Community 2019).

Also try to update Source of nuget.org by going to Tools>Options>NuGet Package Manager>Package Source and click Update Source in case of VS 2017.

like image 35
DTan13 Avatar answered Nov 03 '22 01:11

DTan13