Search code examples
nugetdotnet-tool

dotnet tool update not getting latest version in nuget


I'm playing with dotnet-tool and nuget; I noticed that if I push a refresh nameOfPackage.nupkg to the nuget repo and then run dotnet tool update -g nameOfPackage it does not take the new package version.

I have to force a cache clear to get it to take the latest one.

dotnet nuget locals http-cache -c

I previously installed the package doing

dotnet tool update -g nameOfPackage

Is this by design? Do I have to flush the cache every single time to make sure there are no updates to the tool?


Solution

  • Adding the --no-cache option forces the update.

    dotnet tool update -g nameOfPackage --no-cache
    

    enter image description here

    Source: dotnet tool update