Leemyy
Leemyy
CC#
Created by Leemyy on 12/21/2023 in #help
dotnet tool not recognized after local install
I am trying to locally install the tool dotnet-mgcb-editor from nuget into my repository. But it's not recognized after the installation. Here are the commands I executed to install it, aswell as their output.
>dotnet new tool-manifest
The template "Dotnet local tool manifest file" was created successfully.

>dotnet tool install --local dotnet-mgcb-editor --version 3.8.1.303
You can invoke the tool from this directory using the following commands: 'dotnet tool run mgcb-editor' or 'dotnet mgcb-editor'.
Tool 'dotnet-mgcb-editor' (version '3.8.1.303') was successfully installed. Entry is added to the manifest file <repo>\.config\dotnet-tools.json.
>dotnet new tool-manifest
The template "Dotnet local tool manifest file" was created successfully.

>dotnet tool install --local dotnet-mgcb-editor --version 3.8.1.303
You can invoke the tool from this directory using the following commands: 'dotnet tool run mgcb-editor' or 'dotnet mgcb-editor'.
Tool 'dotnet-mgcb-editor' (version '3.8.1.303') was successfully installed. Entry is added to the manifest file <repo>\.config\dotnet-tools.json.
When I run dotnet tool list, this is the output:
Package Id Version Commands Manifest
----------------------------------------------------------------------------------------
dotnet-mgcb-editor 3.8.1.303 mgcb-editor <repo>\.config\dotnet-tools.json
Package Id Version Commands Manifest
----------------------------------------------------------------------------------------
dotnet-mgcb-editor 3.8.1.303 mgcb-editor <repo>\.config\dotnet-tools.json
But when I try to run the tool, I get an error:
> dotnet mgcb-editor
Could not execute because the specified command or file was not found.
Possible reasons for this include:
* You misspelled a built-in dotnet command.
* You intended to execute a .NET program, but dotnet-mgcb-editor-windows does not exist.
* You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.
> dotnet mgcb-editor
Could not execute because the specified command or file was not found.
Possible reasons for this include:
* You misspelled a built-in dotnet command.
* You intended to execute a .NET program, but dotnet-mgcb-editor-windows does not exist.
* You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.
Here's the output of running dotnet --info in the same repository:
.NET SDK (reflecting any global.json):
Version: 6.0.417
Commit: 04fde1d2e3

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

Host:
Version: 8.0.0
Architecture: x64
Commit: 5535e31a71

.NET SDKs installed:
6.0.417 [C:\Program Files\dotnet\sdk]
8.0.100 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.25 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.25 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.25 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.0 [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:
<repo>\global.json
.NET SDK (reflecting any global.json):
Version: 6.0.417
Commit: 04fde1d2e3

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

Host:
Version: 8.0.0
Architecture: x64
Commit: 5535e31a71

.NET SDKs installed:
6.0.417 [C:\Program Files\dotnet\sdk]
8.0.100 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.25 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.25 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.25 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.0 [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:
<repo>\global.json
And here's the content of my global.json:
{
"sdk": {
"version": "6.0.300",
"rollForward": "latestFeature"
}
}
{
"sdk": {
"version": "6.0.300",
"rollForward": "latestFeature"
}
}
I have tried installing the tool globlally, too, but it leads to the same error. Any pointers or advice would be greatly appreciated, as I am kind of lost here.
9 replies