1

I installed EF with NuGet and the project's dependencies folder shows warning that EF may not be compatible. Which package do I install to use EF from the standard library?

I installed this EF:

enter image description here

Here is the assembly used in another project of the solution:

enter image description here

4
  • Which Entity Framework package did you try to install? The cross-platform one is EF Core Commented Sep 26, 2018 at 12:20
  • I don't know, I have another project and it can be used via System.Data.Entity Commented Sep 26, 2018 at 12:29
  • 4
    That's not EF Core. That's the older EF 6.2 which can only be used in Full framewokr projects. Remove that package and add Microsoft.EntityFrameworkCore Commented Sep 26, 2018 at 12:32
  • Do I need Microsoft.EntityFrameworkCore.SqlServer? Commented Sep 27, 2018 at 0:29

2 Answers 2

1

That's because you added the package for EF 6.2, which only targets the Full framework. It won't work on the .NET Core Runtime.

You need to use Entity Framework Core. This is was fully rewritten to target .NET Standard and fix many of the problems people had with the older Entity Framework.

Since it targets .NET Standard, it can be used in all runtimes - .NET Core, Full framework and UWP projects. Its new features make it a great choice for the Full framework as well. For example, EF Core 2.2 added spatial types support, by using the open source NetTopologySuite package. Even EF 6.2 never had spatial type support.

Entity Framework Core is broken into various packages which enables you to add only the drivers/features you need to your project. Even the SQL Server provider is available as a separate package. A list of providers is available here

Luckily, each provider brings in all other required dependencies so all you need to do is include a provider to bring in all other required packages as transitive dependencies. That means, they don't appear as dependencies in Visual Studio or the csproj file. No more 50 package references that we don't know what to do about!

Sign up to request clarification or add additional context in comments.

Comments

0

Which package do I install to use EF from the standard library?

Just as Panagiotis pointed out, you should use Microsoft.EntityFrameworkCore instead of EntityFramework.

If you download those two packages from nuget.org, EntityFramework, Microsoft.EntityFrameworkCore, then open it with NuGet Package Explorer(You can get it from Microsoft Store.):

enter image description here

enter image description here

So, if you want to use EF from the standard library, you should install the nuget package Microsoft.EntityFrameworkCore.

Hope this helps.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.