dotnet ef command no longer works after upgrading to Visual Studio 16.3.0

dotnet-cli entity-framework entity-framework-core entity-framework-core-3.0

Question

This happened at home first, so I thought maybe it was an issue with my desktop PC at home. But now that I am back at work, I tried the upgrade and got the same thing.

Screenshot before upgrade

dotnet ef command

Screenshot after upgrading Visual Studio

dotnet ef command

The error I get is:

Could not execute because the specified command or file was not found.

Possible reasons for this include:

  • You misspelled a built-in dotnet command.
  • You intended to execute a .NET Core program, but dotnet-ef does not exist.
  • You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.

Any ideas on why this happens? And how do I get back the dotnet ef command. I mean must have been in the $PATH previously, otherwise it wouldn't have worked before.

1
2
9/28/2019 3:58:20 PM

Accepted Answer

This is a breaking change in Entity Framework Core 3.0:

The EF Core command-line tool, dotnet ef, is no longer part of the .NET Core SDK.

...

Starting in 3.0, the .NET SDK does not include the dotnet ef tool, so before you can use it you have to explicitly install it as a local or global tool.

You need to install the Entity Framework Core Tools. To install it globally, run this on the command line:

dotnet tool install --global dotnet-ef
8
9/28/2019 3:57:04 PM


Related Questions





Related

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