# EF Core "dotnet ef" command not found in CI

> Fix "Could not execute because the specified command or file was not found ... dotnet-ef" in CI - the EF Core .NET tool is not installed on the runner.

Source: https://latchkey.dev/learn/dotnet/aspnet-dotnet-ef-command-not-found-in-ci  
Updated: 2026-06-30

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.

## Diagnose it: SDK version and restore first

Most .NET CI failures are an SDK mismatch or a restore that did not happen. `global.json` pins the SDK, and if the runner does not have that exact version the failure message is about the project rather than the SDK.

```Terminal
dotnet --info
cat global.json 2>/dev/null

# restore explicitly so a restore failure is not reported as a build failure
dotnet restore --verbosity normal
dotnet build --no-restore -warnaserror
```

> Pin the SDK with `global.json` and install exactly that version with `actions/setup-dotnet`. A floating SDK turns a runner image update into a build break on unchanged code.

## FAQ

### What causes EF core "dotnet ef" command not found in CI?

There are 2 common causes: the dotnet-ef tool is not installed and a local tool manifest was not restored. A clean runner has no global tools.

### How do I fix EF core "dotnet ef" command not found in CI?

There are 2 fixes depending on which cause you have: install the ef core global tool and restore a local tool manifest. Work through them in order, since the first is the most common.

### What does EF core "dotnet ef" command not found in CI actually mean?

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

### How do I stop EF core "dotnet ef" command not found in CI happening again?

Install or restore dotnet-ef in a dedicated step before any migration command. The prevention section lists 3 changes that keep it from recurring.

---

Latchkey runs CI/CD that repairs its own failures. Agent entry points: https://latchkey.dev/agent.txt, https://latchkey.dev/openapi.json, https://latchkey.dev/llms.txt
