Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to Install Microsoft.EntityFrameworkCore in ASP.NET Core Project

Never had a problem doing this before, but today, when I run the command Install-Package Microsoft.EntityFrameworkCore, the following error ensures:

NU1107: Version conflict detected for Microsoft.EntityFrameworkCore.Abstractions. Install/reference Microsoft.EntityFrameworkCore.Abstractions 2.2.1 directly to 
project WebApplication1 to resolve this issue. 
 WebApplication1 -> Microsoft.EntityFrameworkCore 2.2.1 -> Microsoft.EntityFrameworkCore.Abstractions (>= 2.2.1) 
 WebApplication1 -> Microsoft.AspNetCore.App 2.1.1 -> Microsoft.EntityFrameworkCore.Abstractions (>= 2.1.1 && < 2.2.0).
At line:1 char:1
+ Install-Package Microsoft.EntityFrameworkCore
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand

Install-Package : Package restore failed. Rolling back package changes for 'WebApplication1'.
At line:1 char:1
+ Install-Package Microsoft.EntityFrameworkCore
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand

Really not quite sure how to resolve it.

I attempted to install a previous version to no avail: Install-Package Microsoft.EntityFrameworkCore -Version 2.1.0

like image 926
onefootswill Avatar asked Jan 16 '19 08:01

onefootswill


People also ask

Can I use Entity Framework 6 not core in .NET core?

To use Entity Framework 6, your project has to compile against . NET Framework, as Entity Framework 6 doesn't support . NET Core. If you need cross-platform features you will need to upgrade to Entity Framework Core.

Which of the following packages are needs to install to work EF core in application?

You need to install NuGet packages for the following two things to use EF Core in your application: EF Core DB provider. EF Core tools.


1 Answers

I had the same problem and I just installed EFCore 2.1.11. It seems that EFCore and AspNetCore go side by side in versions.

like image 196
Anis Tissaoui Avatar answered Sep 23 '22 10:09

Anis Tissaoui