Today we are excited to announce the third preview release of EF Core 5.0.
The third previews of .NET 5 and ASP.NET Core 5.0 are also available now.
Prerequisites
The previews of EF Core 5.0 require .NET Standard 2.1. This means:
- EF Core 5.0 runs on .NET Core 3.1; it does not require .NET 5.
- This may change in future previews depending on how the plan for .NET 5 evolves.
- EF Core 5.0 runs on other platforms that support .NET Standard 2.1.
- EF Core 5.0 will not run on .NET Standard 2.0 platforms, including .NET Framework.
How to get EF Core 5.0 previews
EF Core 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 5.0.0-preview.3.20181.2
The EF Core packages published today are:
- Microsoft.EntityFrameworkCore – The main EF Core package
- Microsoft.EntityFrameworkCore.SqlServer – Database provider for Microsoft SQL Server and SQL Azure
- Microsoft.EntityFrameworkCore.Sqlite – Database provider for SQLite
- Microsoft.EntityFrameworkCore.Cosmos – Database provider for Azure Cosmos DB
- Microsoft.EntityFrameworkCore.InMemory – The in-memory database provider
- Microsoft.EntityFrameworkCore.Tools – EF Core PowerShell commands for the Visual Studio Package Manager Console
- Microsoft.EntityFrameworkCore.Design – Shared design-time components for EF Core tools
- Microsoft.EntityFrameworkCore.SqlServer.NetTopologySuite – SQL Server support for spatial types
- Microsoft.EntityFrameworkCore.Sqlite.NetTopologySuite – SQLite support for spatial types
- Microsoft.EntityFrameworkCore.Proxies – Lazy-loading and change-tracking proxies
- Microsoft.EntityFrameworkCore.Abstractions – Decoupled EF Core abstractions
- Microsoft.EntityFrameworkCore.Relational – Shared EF Core components for relational database providers
- Microsoft.EntityFrameworkCore.Analyzers – C# analyzers for EF Core
- Microsoft.EntityFrameworkCore.Sqlite.Core – Database provider for SQLite without a packaged native binary
We have also published the 5.0 preview 3 release of the Microsoft.Data.Sqlite.Core ADO.NET provider.
Installing dotnet ef
As with EF Core 3.0 and 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 preview tool globally, first uninstall any existing version with:
dotnet tool uninstall --global dotnet-ef
Then install with:
dotnet tool install --global dotnet-ef --version 5.0.0-preview.3.20181.2
It’s possible to use this new version of dotnet ef with projects that use older versions of the EF Core runtime.