Using Entity Framework 6 in ASP.NET Core entity-framework-6


Let's say I have:

  • ASP.NET Core stand alone Web API project for .NET Core framework
  • Class Library with EF6 data model for full .NET framework

The ASP.NET Core project refers to the class library

This architecture proposed here:

The question is: will my standalone application be able to execute on the specified target platform (Win, Linux, Mac runtime) after Release (or Publish), if it's dependency targets to full .NET Framework?

Thanks very much

5/2/2017 8:33:33 PM

Expert Answer

Disclaimer: I'm the owner of the project Entity Framework Classic

That's not possible directly Entity Framework as @Adailson answered

However, it's possible via EF Classic:

That's an EF6 fork that also supports .NET Core. We plan to integrate a ton of features & bug fix.

A community (FREE) and enterprise version (PAID) is available.

What's EF Classic

Entity Framework Classic is a supported version from the latest EF6 code base. It supports .NET Framework and .NET Core and overcomes some EF limitations by adding tons of must-haves built-in features.

8/12/2018 6:01:37 PM

Popular Answer

It will be not possible. The same link you provided confirm that:

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

You can use ASP.NET Core upon .NET Framework (Not .NET CORE) and EF6 (But not cross-platform). But not ASP.NET Core upon .NET Core and use EF6. You will need to use EF Core for that project.

Related Questions


Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow