C
C#9mo ago
aes

❔ Update all packages in project or sln

With the Nuget Package Manager console, you can update all packages in a project (or solution I think) with
Update-Package
Update-Package
which is useful in general but also useful for me especially with the Include-Prerelease switch can you do the same thing with the dotnet CLI? Does not work:
dotnet add package --prerelease
dotnet add package --prerelease
dotnet update package --prerelease
dotnet update package --prerelease
10 Replies
mtreit
mtreit9mo ago
I don't think the built-in dotnet tooling supports this, but you install this tool:
dotnet tool install --global dotnet-outdated-tool
dotnet tool install --global dotnet-outdated-tool
And then you can run:
[12:30:37] ✓ dotnet-outdated --upgrade
» Scratch
[net7.0]
BenchmarkDotNet 0.13.3 -> 0.13.8

Version color legend:
<red> : Major version update or pre-release version. Possible breaking changes.
<yellow>: Minor version update. Backwards-compatible features added.
<green> : Patch version update. Backwards-compatible bug fixes.

Upgrading package BenchmarkDotNet...
Project Scratch [net7.0] upgraded successfully

Elapsed: 00:00:06.9476695
[12:30:37] ✓ dotnet-outdated --upgrade
» Scratch
[net7.0]
BenchmarkDotNet 0.13.3 -> 0.13.8

Version color legend:
<red> : Major version update or pre-release version. Possible breaking changes.
<yellow>: Minor version update. Backwards-compatible features added.
<green> : Patch version update. Backwards-compatible bug fixes.

Upgrading package BenchmarkDotNet...
Project Scratch [net7.0] upgraded successfully

Elapsed: 00:00:06.9476695
Not sure about pre-release Oh it has a --pre-release flag
WEIRD FLEX
WEIRD FLEX9mo ago
don't update package updates only the specific project packages if executed in the project folder?
mtreit
mtreit9mo ago
Is dotnet update a thing? It doesn't exist in the SDK I'm using.
WEIRD FLEX
WEIRD FLEX9mo ago
dotnet nuget update at least, i believe it's that one
mtreit
mtreit9mo ago
I don't think that is for updating packages to new versions. Neither dotnet nuget update or dotnet nuget upgrade seem to allow upgrading package versions.
WEIRD FLEX
WEIRD FLEX9mo ago
yeah, true, it's not the correct command it would be just nuget update
mtreit
mtreit9mo ago
The tool I showed seems to work great, I would just use that.
aes
aes9mo ago
Thank you for the response where is the package directory for dotnet tool? I saw dotnet-outdated-tool online but I assumed it was an annoying thing I'd have to install with an exe or something that covers what the SDK might already have but as a cli tool i can install from the cli that's great but im curious where the default package registry is from
mtreit
mtreit9mo ago
I think it's nuget.org
Accord
Accord9mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.