Why does dotnet update reinstall the existing version?
See original GitHub issuedotnet update -g MyTool
seems to reinstall the tool, which takes quite long. In case the version is up to date i get the following output:
‘MyTool’ was reinstalled with the latest stable version (version ‘1.0.1564914607’)
What I wish is just an check for a newer version, and install it if available. Is there any undocumented flag to achieve that?
Why do I need that? I distribute workflows (e.g. Build pipelines) via global tools. And provide shell scripts for the workflows. So whenever the shell script is executed it shall run with the latest global tool behind, but in the same time the shell script should start as fast as possible. Thats why the reinstallation of the tools when they are already up to date is a bit annoying.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:5
- Comments:12 (6 by maintainers)
Top Results From Across the Web
Reinstalling and Updating NuGet Packages
Updating a package simply means installing an updated version, ... In a similar scenario, you can restore packages with the dotnet CLI.
Read more >dotnet tool update command - .NET CLI
The dotnet tool update command provides a way for you to update .NET tools on your machine to the latest stable version of...
Read more >Remove the .NET runtime and SDK
The package manager update or refresh commands will automatically remove the older version upon the successful installation of a newer version.
Read more >dotnet restore command - .NET CLI
For project-specific tooling, dotnet restore first restores the package in which the tool is packed, and then proceeds to restore the tool's ...
Read more >Repair an installation of .NET Framework
This article describes how to repair the existing installation of Microsoft .NET Framework if you upgrade your operating system.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@nkolev92 Maybe I don’t understand the problem. My idea is: Keep the whole installation as it is, but compare the installed version with the latest version that you get via the nuget api (list command), before you do the installation. If the versions are equal, don’t install. Wouldn’t that be sufficient to avoid unnecessary reinstallations?
@TFTomSun
Some sample code for this would be helpful because I’m about to attempt the same thing. I agree that it would be very nice to have a flag on
dotnet tool update
that will skip the uninstall/re-install if the versions match. Or if otherwise it can be made faster than it currently is.Our use case is that we distribute tools to users by setting up a bash alias to the tool - which periodically runs the dotnet tool update command on their behalf. It would be nice if that could be as fast as possible when it’s a no-op (i.e. the tool version hasn’t changed).