Announcing Entity Framework Core 3.1 and Entity Framework 6.4

Avatar

Arthur

Announcing Entity Framework Core 3.1 and Entity Framework 6.4

We are excited to announce the general availability of EF Core 3.1 and EF 6.4 on nuget.org.

The final versions of .NET Core 3.1 and ASP.NET Core 3.1 are also available now.

How to get EF Core 3.1

EF Core 3.1 is distributed exclusively as a set of NuGet packages. For example, to add the SQL Server provider to your project, you can use the following command using the dotnet tool:

dotnet add package Microsoft.EntityFrameworkCore.SqlServer --version 3.1.0

When upgrading applications that target older versions of ASP.NET Core to 3.1, you may also have to add the EF Core packages as an explicit dependency.

Starting in 3.0 and continuing for 3.1, the dotnet ef command-line tool is no longer included in the .NET Core SDK. Before you can execute EF Core migration or scaffolding commands, you’ll have to install this package as either a global or local tool. To install the final version of our 3.1.0 tool as a global tool, use the following command:

dotnet tool install --global dotnet-ef --version 3.1.0

It’s possible to use this new version of dotnet ef with projects that use older versions of the EF Core runtime. However, older versions of the tool will not work with EF Core 3.1.

What’s new in EF Core 3.1

The primary goal of EF Core 3.1 is to polish the features and scenarios we delivered in EF Core 3.0. EF Core 3.1 will be a long term support (LTS) release, supported for at least 3 years. To this end we have fixed over 150 issues for the 3.1 release, but there are no major new features to announce.

EF Core 3.1 reintroduces support for .NET Standard 2.0, rather than requiring .NET Standard 2.1 as was the case for EF Core 3.0. This means EF Core 3.1 will run on .NET Framework versions that support the standard.

What’s new in EF 6.4

Similar to EF Core, the primary goal of EF 6.4 is to polish the features and scenarios we delivered in EF 6.3. To this end we have fixed important issues found in EF 6.3 to create a more stable release.

What’s next

Planning for the EF Core “5.0” release (i.e. the one after 3.1) has started and we are making good progress. We will have something to share on GitHub soon.

Thank you

A big thank you to the following community contributors to EF Core and EF6 as part of this release.

@breyed
@chrfin
@crowet
@EricStG
@guftall
@gurmeetsinghdke
@ite-klass
@jfoshee
@jtheisen
@mistachkin
@morrisjdev
@OOberoi
@pacoweb
@pmiddleton
@Psypher9
@ptjhuang
@riccikl
@ronnelsantiago
@skalpin
@StefH
@vanillajonathan
@Youssef1313

Documentation and feedback

The starting point for all Entity Framework documentation is https://docs.microsoft.com/ef/.

Please file issues found and any other feedback on GitHub for EF Core or EF6.

14 comments

Comments are closed.

  • Avatar
    Marcel

    Hey Arthur, do you know if EF 6.4 will run on .NET 3.0 SDK/runtime? (or does it require 3.1)

    With the Azure team still not having deployed .NET Core 3.0 yet (https://github.com/Azure/app-service-announcements-discussions/issues/118), the 2.2 SDK is the latest available on Azure so we’re trying to understand whether we should upgrade to .Net Core 3.0 or if we are better off waiting until 3.1 is available on Azure (perhaps next spring hopefully??) so that we can pick up the bug-fixes for EF 6.4.

  • Avatar
    Jon Miller

    Thanks for getting it working on .NET Framework again. That is great news and greatly appreciated. I look forward to being able to test the new query engine. There were queries on EF 6 that I was never able to get to work satisfactorily on EF Core. So, I had to use both. I am hopeful that now that the query engine has been reworked that I can maybe finally switch everything over to EF Core.

  • Avatar
    Charles

    Hi Arthur,

    I could not get ef migrations working on 3.1. I initially thought it was a PATH issue, but every time I try to run an ef command, it gives me the following error. Could “not execute because the specified command or file was not found.” I deleted the files, reinstall it, but the same problem. I added all the package references as needed and follow instructions on Microsoft’s web site. It seems version 3 is not yet production-ready.

    I reverted back to 2.2 and everything worked perfectly. Am I missing something?

  • Tanveer Badar
    Tanveer Badar

    I was going through the fixed issues list for EF Core 3.1. At least some of them have been closed with “try-on-latest”, which doesn’t inspire much confidence in me about the fixed bug count. It is almost equivalent to “works on my machine” if that’s all the investigation anyone did. If any investigation was done, it is not visible in the bug report itself.

  • S Kumar
    S Kumar

    sir/mam,
    how to create table if table not exists to existing database by code first approach in ef core ?

    we don’t use migration because our existing databases are with clients devices and want to create additional tables to their databases after updates for feature extensions…

    there was an option like Context.DbEntity.Create(); in ef6 but not getting in ef core to do so…

    I used the below but it also not creating tables which doesn’t exist i.e. recently DbSet…

    try
    {
    var databaseCreator = (Database.GetService() as RelationalDatabaseCreator);
    databaseCreator.CreateTables();
    }
    catch (Exception ex)
    {
    System.Console.WriteLine(ex.Message);
    }

    Regards-
    Sanjeeb

  • Avatar
    Naved Rasul

    Thanks for reaching out to the community and sharing the updates in a relatively casual manner. Such style of communication will foster the .NET development community like we have seen in the case of open-source communities. 👍🏼🙂