Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically create a local tool-manifest when a tool is installed and no manifest exists #27736

Closed
baronfel opened this issue Sep 7, 2022 · 3 comments
Labels
Area-Tools untriaged Request triage from a team member

Comments

@baronfel
Copy link
Member

baronfel commented Sep 7, 2022

Is your feature request related to a problem? Please describe.

Right now when a user installs a tool into a new project, they immediately get an error instead of a successful tool installation

 ➜ dotnet tool install fantomas --prerelease
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.

Describe the solution you'd like

When installing a local tool, if no manifest exists in the heirarchy one should be created inside a .config directory at the current working directory. There's no need for a user to execute an entirely different command (template creation of a tool manifest) to get unblocked here. We should log that this action was done on the user's behalf. If the user doesn't want this behavior, they can remove + recreate the file at the desired level of the heirarchy.

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged Request triage from a team member label Sep 7, 2022
@baronfel baronfel added this to the 8.0.1xx milestone Sep 7, 2022
@tboby
Copy link

tboby commented Sep 8, 2022

There is some more discussion about this here: #15254

It'd be great to have though! Having to litter dotnet new tool-manifest all over my CI/CD just to run post-processing tools like test results converters is a pain. And global tools don't work for shared runners.

@augustoproiete
Copy link

This seems like a duplicate of When installing a .NET local tool, create the tool manifest if one does not exist
#15254

Related comment:

augustoproiete commented on May 17, 2021

.NET tools is lacking the ability to have a simple command that does exactly what it's being asked: Ensure that a .NET tool is installed and exit gracefully.

The current state leave us with poor a UX:

image https://www.nuget.org/packages/dotnet-reportgenerator-globaltool/

You should be able to copy/paste the instructions on how to install a .NET tool, and it should work on any machine regardless if the tool is installed or not, manifest or not... But that's not where we are today.


It's worth noting that creating the manifest automatically would be a great step forward, when the manifest already exists and the tool is already installed, the command fails... We need it to not fail (i.e. error code == 0) if the tool we want already exists.

Also, if you have a global.json it gets in the way of installing tools as well

@baronfel
Copy link
Member Author

baronfel commented Mar 1, 2023

You are both correct, I'm going to close this in favor of #15254 and add that one to our candidate list for improvements to tools in .NET 8.

@baronfel baronfel closed this as not planned Won't fix, can't repro, duplicate, stale Mar 1, 2023
@baronfel baronfel removed this from the 8.0.1xx milestone Mar 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Tools untriaged Request triage from a team member
Projects
None yet
Development

No branches or pull requests

3 participants