Skip to content
Latchkey

EF Core "dotnet ef" command not found in CI

A step ran dotnet ef ... but the dotnet-ef global (or local) tool is not installed on the runner. Install the tool before running any migration or database command in CI.

What this error means

A migration step fails with "Could not execute because the specified command or file was not found." naming dotnet-ef, or "No executable found matching command \"dotnet-ef\"".

.NET
Could not execute because the specified command or file was not found.
Possible reasons for this include:
  * You misspelled a built-in dotnet command.
  * ... the tool 'dotnet-ef' does not exist.
No executable found matching command "dotnet-ef".

Common causes

The dotnet-ef tool is not installed

A clean runner has no global tools. dotnet ef is a separate .NET tool that must be installed explicitly, unlike built-in commands such as dotnet build.

A local tool manifest was not restored

If you use a dotnet-tools.json manifest, dotnet tool restore must run first, otherwise the local dotnet ef is unavailable.

How to fix it

Install the EF Core global tool

  1. Install dotnet-ef as a global tool in a step before migrations.
  2. Ensure the tools directory is on PATH (setup-dotnet adds ~/.dotnet/tools).
  3. Pin the tool version to match your EF Core package version.
.github/workflows/ci.yml
- run: dotnet tool install --global dotnet-ef --version 8.0.*
- run: dotnet ef database update

Restore a local tool manifest

If EF is pinned in a manifest, restore it and invoke via dotnet ef (or dotnet tool run dotnet-ef).

Terminal
dotnet tool restore
dotnet ef migrations list

How to prevent it

  • Install or restore dotnet-ef in a dedicated step before any migration command.
  • Pin the tool version to the EF Core version to avoid provider mismatches.
  • Prefer a committed dotnet-tools.json manifest so the version is reproducible.

Frequently asked questions

What causes ""No executable found matching command dotnet-ef""?
A clean runner has no global tools. dotnet ef is a separate .NET tool that must be installed explicitly, unlike built-in commands such as dotnet build.
How do I fix "No executable found matching command dotnet-ef"?
Install the EF Core global tool

Related guides

References

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