question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`dotnet tool restore` cannot find the local manifest file

See original GitHub issue

Describe the bug

After upgrading dotnet to 7.0.9, dotnet tool restore cannot find the manifest file in .config/dotnet-tools.json

It returns:

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

Running dotnet new tool-manifest will reset the manifest file and after adding the tools it still do not pick those tools up.

Affected platforms

This only happens on Windows. MacOS seems to work. Have not tried linux.

To Reproduce

  1. Run dotnet new tool-manifest
  2. Add a tool. See example below. (running dotnet tool install Cake.Tool --version 3.1.0 will also fail with same error)
  3. Run dotnet tool restore

.config/dotnet-tools.json

{
  "version": 1,
  "isRoot": true,
  "tools": {
    "cake.tool": {
      "version": "3.1.0",
      "commands": [
        "dotnet-cake"
      ]
    }
  }
}

Further technical details

dotnet --info

.NET SDK:
 Version:   7.0.306
 Commit:    f500069cb7

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.22621
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\7.0.306\

Host:
  Version:      7.0.9
  Architecture: x64
  Commit:       8e9a17b221

.NET SDKs installed:
  5.0.405 [C:\Program Files\dotnet\sdk]
  7.0.103 [C:\Program Files\dotnet\sdk]
  7.0.304 [C:\Program Files\dotnet\sdk]
  7.0.306 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 3.1.22 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.14 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.18 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 3.1.22 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.14 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.14 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.15 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.16 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.18 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 3.1.22 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 5.0.14 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.18 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 7.0.7 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 7.0.9 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
  x86   [C:\Program Files (x86)\dotnet]
    registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
  Not set

global.json file:
  Not found

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download

Issue Analytics

  • State:open
  • Created 2 months ago
  • Reactions:2
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
baronfelcommented, Jul 11, 2023

@JL03-Yue can you take a look at this? It might be related to your recent fix.

0reactions
KalleOlaviNiemitalocommented, Aug 18, 2023

The breaking change document Tool manifests in root folder mentions that the original behaviour can be restored by setting the DOTNET_TOOLS_ALLOW_MANIFEST_IN_ROOT environment variable.

Read more comments on GitHub >

github_iconTop Results From Across the Web

When installing a .NET local tool, create the tool manifest if ...
When a user tries to install a .NET tool as a local tool on a folder that does not contain the manifest, we...
Read more >
Tutorial: Install and use .NET local tools - .NET CLI
To install all of the tools listed in the manifest file, they can run a single dotnet tool restore command. Save your changes....
Read more >
.NET Tools - Cannot find a manifest file
However when I tried to install a specific tool locally, it failed with the following error message: “Cannot find a manifest file.” dotnet...
Read more >
Cannot list Entity Framework Migrations in Visual Studio ...
I tried to understand what is wrong. dotnet tool restore. Cannot find a manifest file. For a list of locations searched, specify the...
Read more >
.NET core local tools are here! - Bilal Fazlani
You can create a manifest file by running dotnet new tool-manifest . This will create a .config directory and inside it, an empty...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found