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.
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.
dotnet new tool-manifest
dotnet tool install dotnet-ef
git add .config/dotnet-tools.jsonRun restore from the manifest’s directory
Set the working directory to the repo root (or wherever .config/ lives) before restoring.
- run: dotnet tool restore
working-directory: . # where .config/dotnet-tools.json livesHow to prevent it
- Commit
.config/dotnet-tools.jsonat the repo root. - Run
dotnet tool restorefrom a directory at or under the manifest. - Verify the manifest is included in the checkout (watch sparse checkouts).