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.
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
- Install EF tools (a local tool manifest is most reproducible).
- Pass
--projectand--startup-projectexplicitly. - Re-run the EF command.
dotnet tool install dotnet-ef --version 9.0.0
dotnet ef migrations script --project src/Data --startup-project src/ApiHow to prevent it
- Pin EF tools in a committed
.config/dotnet-tools.jsonand rundotnet tool restorein CI. - Always pass explicit project/startup-project paths in CI.