-
Notifications
You must be signed in to change notification settings - Fork 1.1k
When installing a .NET local tool, create the tool manifest if one does not exist #15254
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
Comments
The side of doing that is we could potentially generating manifest file accidentally on unexpected locations. And people could run unexpected tool. |
Add a |
Prefer to NuGet/NuGetGallery#8373 (comment) |
The current behavior -- asking the user to run |
@wli3 The end goal is to be able to run a command (or set of commands) that ensures that a particular dotnet tool, of a particular version, is installed. Use-case: Write a set of instructions on how to add a dotnet tool, that someone can copy/paste and run, and it always works.Let's examine the following example: dotnet new tool-manifest
dotnet tool install --local toolname --version toolversion At the moment, it's impossible to guarantee that the instructions above will work for everyone, because:
As you can see, it's impossible to send someone a set of instructions that will always work when they run. Would it be possible to have along the lines of the following:
So that both commands above do not throw an error, and return exit code = 0. I also suggested an alternative approach on #10310 (comment) which aims to achieve the same goal: Ensure that a dotnet tool is installed, without throwing errors.
The above would mean that the manifest is created automatically, so that everything can be done with one command. Expectations:
/cc @KathleenDollard |
Finding an analog, NPM does this by default as well with package.json and puts it in the right place. Users who do |
"easy experience" -- no, it does not. By default, npm drop it into the package folder and you have no way to call it unless you run it with the full path. That is similar with --tool-path option. (unless install npx) dotnet tool -g experience is very similar to npm install -g experience. |
I just did the example I noted and it did all the right things locally. Yes I know -g is the same for both. We are talking here about local. We need to reduce ceremony here. This shouldn't be hard to do the 90% expected case |
let's have a meeting. I don't know what is the "right thing". The default npm experience is confusing to me too. |
My team just went through an exercise where we were trying a .net core tool in a local folder and they were tripped up by this. I think the manifest file should be created by default. Obviously they were able to get it working, but it could have been more streamlined.
I don't understand this risk, because the user would have had to execute I'm happy to meet to discuss more. |
If you are not careful, you could get manifest created in your root, obj folder, bin folder, the folder above the repo or the nested folder for the sub projects. And people will get confused when the tool does not show up. And only the repo owner should create the manifest file. People need to put thoughts on where the manifest file should be located. @sayedihashimi @timheuer @KathleenDollard we've been discussing this issue on theoretical base. I prefer not to change one default to another default without any data or objective user study. |
Straw man design: Add a new
@baronfel What do you think? Anything suggestions? I'm thinking of having @JL03-Yue start to work on this. |
Also related: #23561 If we do a |
If you're going to have a Git-specific feature, then it should recognize a |
Sorry, I just saw this ping. I worry that an optional flag (especially a long one!) will get very little use, especially with the very low rates of tab-completion registration and usage. What if we
That would make the simple usage do what the user intended, while also giving automation tools to more firmly specify the inputs when required. |
Resolved in #31231 |
init first: |
When a user tries to install a .NET tool as a local tool on a folder that does not contain the manifest, we get an error
Cannot find a manifest file
.However, if the user tries to update an existing local tool,
dotnet tool
is able to update the existing manifest:TL;DR; It would be great if
dotnet tool install
automatically created the tool manifest, if one does not exist when installing a local tool, instead of failing with an error.The text was updated successfully, but these errors were encountered: