C
C#14mo ago
麺麭

❔ 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
mtreit14mo 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
Omnissiah
Omnissiah14mo ago
don't update package updates only the specific project packages if executed in the project folder?
mtreit
mtreit14mo ago
Is dotnet update a thing? It doesn't exist in the SDK I'm using.
Omnissiah
Omnissiah14mo ago
dotnet nuget update at least, i believe it's that one
mtreit
mtreit14mo 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.
Omnissiah
Omnissiah14mo ago
yeah, true, it's not the correct command it would be just nuget update
mtreit
mtreit14mo ago
The tool I showed seems to work great, I would just use that.
麺麭
麺麭OP14mo 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
mtreit14mo ago
I think it's nuget.org
Accord
Accord14mo 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.
Want results from more Discord servers?
Add your server