Microsoft dotnet ef migration error

Kefiloe Moshoaliba 6 Reputation points
2022-11-17T16:11:22.873+00:00

When I run any dotnet ef command, like "dotnet ef migrations add InitialCreate", i get the following error message:

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 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.

The dotnet ef is already installed.

.NET
.NET
Microsoft Technologies based on the .NET software framework.
4,103 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Michael Taylor 57,216 Reputation points
    2022-11-17T18:17:14.943+00:00

    Run dotnet tool list and show us what you get back. If EF is not part of that then you don't have the version of the tool installed that your dotnet CLI is running against. Install it again using the dotnet CLI.

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.