Skip to content
Latchkey

dotnet ef "No project was found" / EF Core tools not installed in CI

dotnet ef needs the EF Core CLI tool installed and a project to operate on. In CI it fails either because dotnet-ef was never installed (the tool is not a default), or because the command ran in a directory with no project for it to target.

What this error means

The step fails with "Could not execute because the specified command or file was not found (dotnet-ef)" or "No project was found in the current working directory." It reproduces every run.

dotnet
Could not execute because the specified command or file was not found (dotnet-ef).
# or
No project was found. Change the current working directory or use the --project option.

Common causes

EF Core tools are not installed on the runner

The dotnet-ef global or local tool was never installed, so the CLI cannot find the command.

The command ran without a target project

dotnet ef ran in a folder with no project and no --project/--startup-project arguments.

How to fix it

Install the tool and point it at the project

  1. Install EF tools (a local tool manifest is most reproducible).
  2. Pass --project and --startup-project explicitly.
  3. Re-run the EF command.
shell
dotnet tool install dotnet-ef --version 9.0.0
dotnet ef migrations script --project src/Data --startup-project src/Api

How to prevent it

  • Pin EF tools in a committed .config/dotnet-tools.json and run dotnet tool restore in CI.
  • Always pass explicit project/startup-project paths in CI.

Frequently asked questions

What causes ""No project was found" / EF tools"?
The dotnet-ef global or local tool was never installed, so the CLI cannot find the command.
How do I fix "No project was found" / EF tools?
Install the tool and point it at the project

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card