question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Why does dotnet update reinstall the existing version?

See original GitHub issue

dotnet 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:open
  • Created 4 years ago
  • Reactions:5
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
TFTomSuncommented, Aug 5, 2019

@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?

0reactions
idlem1ndcommented, Mar 13, 2020

@TFTomSun

you can use the nuget console api, which is pretty close to the nuget.exe CLI. Its cross platform and provides the list command, which allows you to query for the latest version of a package. Then you can compare that version with the one that is already installed. I can provide sample code tomorrow, if necessary.

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).

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found