Announcing Entity Framework 6.3 Preview with .NET Core Support

Avatar

Diego

The first preview of the EF 6.3 runtime is now available in NuGet.

Note that the package is versioned as 6.3.0-preview5. We plan to continue releasing previews of EF 6.3 every month in alignment with the .NET Core 3.0 previews, until we ship the final version.

What is new in EF 6.3?

While Entity Framework Core was built from the ground up to work on .NET Core, 6.3 will be the first version of EF 6 that can run on .NET Core and work cross-platform. In fact, the main goal of this release is to facilitate migrating existing applications that use EF 6 to .NET Core 3.0.

When completed, EF 6.3 will also have support for:

  • NuGet PackageReferences (this implies working smoothly without any EF entries in application config files)
  • Migration commands running on projects using the the new .NET project system

Besides these improvements, around 10 other bug fixes and community contributions are included in this preview that apply when running on both .NET Core and .NET Framework. You can see a list of fixed issues in our issue tracker.

Known limitations

Although this preview makes it possible to start using the EF 6 runtime on .NET Core 3.0, it still has major limitations. For example:

  • Migration commands cannot be executed on projects not targeting .NET Framework.
  • There is no EF designer support for projects not targeting .NET Framework.
  • There is no support for building and running with models based on EDMX files on .NET Core. On .NET Framework, this depends on a build task that splits and embeds the contents of the EDMX file into the final executable file, and that task is not available for .NET Core.
  • Running code first projects in .NET Core is easier but still requires additional steps, like registering DbProviderFactories programmatically, and either passing the connection string explicitly, or setting up a DbConnectionFactory in a DbConfiguration.
  • Only the SQL Server provider, based on System.Data.SqlClient, works on .NET Core. Other EF6 providers with support for .NET Core haven’t been released yet.

Besides these temporary limitations, there will be some longer term limitations on .NET Core:

  • We have no plans to support the SQL Server Compact provider on .NET Core. There is no ADO.NET provider for SQL Server Compact on .NET Core.
  • SQL Server spatial types and HierarchyID aren’t available on .NET Core.

Getting started using EF 6.3 on .NET Core 3.0

You will need to download and install the .NET Core 3.0 preview 5 SDK. Once you have done that, you can use Visual Studio to create a Console .NET Core 3.0 application and install the EF 6.3 preview package from NuGet:

Next, edit the Program.cs file in the application to look like this:

Closing

We would like to encourage you to download the preview package and try the code first experience on .NET Core and the complete set of scenarios on .NET Framework. Please, report any issues you find to our issue tracker.

Avatar
Diego Vega

Program Manager , .NET Data Access

Follow Diego   

40 Comments
Avatar
Damien Dennehy 2019-05-08 15:40:58
"There is no support for building and running with models based on EDMX files on .NET Core." Is there a plan to support this in 6.3 final? Our main data access layer uses a Database first EDMX. I accept that it might not be possible at all but if we have a definitive statement on this at least we can move forward with a migration plan.
Avatar
Jonathan Allen 2019-05-08 17:25:11
So what are we supposed to do about spatial types? Use .NET Framework forever?
Avatar
Robert McLaws 2019-05-08 22:03:33
Regarding the EDMX issue, I built a T4 generator to solve this problem for SDK projects targeting the .NET Framework about a year ago. I've open-sourced it at https://github.com/CloudNimble/EF6.3MetadataGenerator. Hopefully it helps fill in the gap. I've opened an issue on GitHub (https://github.com/aspnet/EntityFramework6/issues/828) to discuss if this would be useful in the final product, or what other alternatives are possible. Please let me know if there is any way I can help.
Avatar
Stilgar Naib 2019-05-09 15:21:04
Will you also release Core versions of ASP.NET Identity?
Avatar
Ben Hayat 2019-05-09 15:55:01
Diego, I'm a bit confused.Is 6.3 for the developers who are using .Net and EF 6 to move to .Net Core or 6.3 the new version # for those who are building .Net Core apps?As of april 18th it was called "Entity Framework Core 3.0 Preview 4". Now it suddenly became "Entity Framework 6.3 Preview"?I think this blog needs a bit more clarification.Thanks!..Ben
Avatar
Bill Kratochvil 2019-05-12 05:08:21
On the following link I demonstrate how you can use EDMX with your EF 6.3 project using "linked" files http://www.adventuresontheedge.net/post/2019/05/12/Creating-an-edmx-with-Entity-Framework-63-Preview
Avatar
Weijie JIN 2019-05-13 19:16:15
Thanks Diego for the update. I know it maybe duplicated, but just want to mention that please put Database first in priority because a lot of big and complex projects are using DB first approach. Thanks!
Avatar
Philip Gruebele 2019-05-14 04:14:33
Lack of support for SQL Server spatial types will prevent our app (and I am sure many others) from migrating to EF 6.3/.Net Core 3. This seems like a grave oversight to me.
Avatar
Werner Kellens 2019-05-14 22:54:57
With the limitations for EF 6.3 is it better to write a datalayer in .NET Framework? So that your .NET Core/Stardard can communicate with the datalayer. And then in the future migrate to .NET Core en .NET Core EF
Avatar
tom.wilson 2019-05-16 13:21:04
I would like to adopt this by sharing my "Model" project which contain by DBContext and is currently being used by .net 4.6 with a .net core v3 app.  Would I need to uprgade my "Model" project to be on .net standard, so that both my new .net core v3 projects and my .net 4 projects can co-exist?
Avatar
Rodolfo Jover Labiste 2019-05-20 08:07:30
Class Person o People?...
Avatar
Mike Wink 2019-05-21 04:11:48
How do I use the new Microsoft.Data.SqlClient provider with EF 6.3?When I change the reference to the new namespace and tty registering the factory like this..DbProviderFactories.RegisterFactory("Microsoft.Data.SqlClient", Microsoft.Data.SqlClient.SqlClientFactory.Instance);when I then try to access the context I get the following error!'Unable to determine the provider name for provider factory of type 'System.Data.SqlClient.SqlClientFactory'.
Avatar
Oleg Mikhailov 2019-05-23 13:31:59
These are really good news, I hope that full EF 6 will be available on UWP. The lack of database first approach is one of the limitations forcing me to write WPF applications when it is required to work with database server from local network.
Donovan Edye
Donovan Edye 2019-05-23 23:25:33
So unless you need to bring EF 6 "with you" to .NET Core 3.0 and ultimately .NET 5, is it preferable to rather use EF .Net Core when starting a new project that is .NET Core 3 / .NET Standard 2 and ultimately .NET 5?
Avatar
Bubi 2019-06-08 16:28:25
About the providers, what could be the best way for the update? Start from 6.2 provider or start from sql server 6.3 provider? Should the providers backward compatible with Ef 6.2?