Skip to content
Latchkey

dotnet "Cannot find a manifest file" - Tool Restore in CI

A dotnet tool restore needs a local tool manifest (.config/dotnet-tools.json). When the manifest is missing from the current directory tree, the command cannot tell which tools to install and fails.

What this error means

dotnet tool restore fails saying it cannot find a manifest file, listing the directories it searched. It happens when the manifest was never committed, or the step runs in a directory that is not under the manifest.

Terminal
Cannot find a manifest file.
For a list of locations searched, specify the "-d" option before the tool name.
No manifests were found.

Common causes

Manifest not committed to the repo

The .config/dotnet-tools.json was never created or was gitignored, so CI has no manifest to restore from.

Step runs outside the manifest’s directory tree

dotnet tool restore searches the current directory and its parents. A step running in a subdirectory that is not under the manifest finds nothing.

How to fix it

Create and commit a tool manifest

Initialize the manifest, add the tools, and commit it so CI can restore them.

Terminal
dotnet new tool-manifest
dotnet tool install dotnet-ef
git add .config/dotnet-tools.json

Run restore from the manifest’s directory

Set the working directory to the repo root (or wherever .config/ lives) before restoring.

.github/workflows/ci.yml
- run: dotnet tool restore
  working-directory: .   # where .config/dotnet-tools.json lives

How to prevent it

  • Commit .config/dotnet-tools.json at the repo root.
  • Run dotnet tool restore from a directory at or under the manifest.
  • Verify the manifest is included in the checkout (watch sparse checkouts).

Frequently asked questions

What causes ""Cannot find a manifest file""?
The .config/dotnet-tools.json was never created or was gitignored, so CI has no manifest to restore from.
How do I fix "Cannot find a manifest file"?
Initialize the manifest, add the tools, and commit it so CI can restore them.

Related guides

References

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