dotnet-ef is not compatible with net50

1.2k Views Asked by At

I'm using .NET 5 with Rider and trying to install dotnet-ef for working with migrations.

I got next packages installed:

  • Microsoft.EntityFrameworkCore
  • Microsoft.EntityFrameworkCore.Design
  • Microsoft.EntityFrameworkCore.SqlServer
  • Microsoft.EntityFrameworkCore.Tools
  • Microsoft.EntityFrameworkCore.SqlServer.Design

But when typing dotnet tool install -g dotnet-ef in the terminal i get the error, which says:

Package dotnet-ef 5.0.7 is not compatible with net50 (.NETFramework,Version=v5.0) / any. Package dotnet-ef 5.0.7 supports: netcoreapp3.1 (.NETCoreApp,Version=v3.1) / any

Even when I run CMD as an admin I get the same error

So I clearly see that the latest version of dotnet-ef is for .NET 3.1. Is that really true? Is there no version of dotnet-ef for .NET 5? What can I be doing wrong?

I tried different versions of dotnet-ef and got different kinds of this error (depending on the choosen version).

Write in the comments if you need any other info.

1

There are 1 best solutions below

1
On

I got the same error when I try to use nuget to get the dotnet-ef : But I tried in package manager console:

dotnet tool install --global dotnet-ef

and it works (difference is the --global). Source: https://learn.microsoft.com/en-us/ef/core/cli/dotnet