dotnet / dotnet/command-line-api

dotnet tool install can return an incorrect error message

Open
#2,404 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
3.7k
Forks
428
PR merge metrics
No merged PRs in 30d

Description

### Description

If you try to install a tool with a command like:
`dotnet tool install bad.tool.name`
you receive an error message of:
```
Cannot find a manifest file.
For a list of locations searched, specify the "-d" option before the tool name.
If you intended to install a global tool, add `--global` to the command.
If you would like to create a manifest, use `dotnet new tool-manifest`, usually in the repo root directory.
```
If you follow the suggestion in the message and add "-d", you get an error of:
`Unrecognized command or argument 'bad.tool.name'.`
That error is then followed by help text which doesn't mention a "-d" option.
I have not found a way to get it to accept a "-d" option nor have I found a way to get it to list the locations searched.

### Reproduction Steps

The steps to reproduce are part of the description.

### Expected behavior

Adding "-d" would list each location searched when the command is searching for the tool manifest.

### Actual behavior

No search location information is displayed and the suggested option is invalid.

### Regression?

I don't know if this has ever worked.

### Known Workarounds

No known workarounds.

### Configuration

8.0.300-preview.24203.14

Windows 11 on x64

### Other information

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.