Using the dotnet cli how can you list the available package versions for a specific package?
Short answer: It's not possible (as far as I know, as of Nov 25, 2019).
There are some other options, depending on what you're trying to accomplish.
- You can see the latest version(s) of installed packages you have that are outdated by running
dotnet list package --outdated
(requires .NET Core CLI 2.2+). - You can manually view the available versions for a package at nuget.org/packages. Not a CLI option, but that's an option.
dotnet add package Newtonsoft.Json --version 100.1.1
with any version that we are sure does not exists and it will fail, but also in the output there will be latest version available. Not ideal but something I guess :) –
Fredrick It's possible with "dotnet-search" a dotnet tool.
https://github.com/billpratt/dotnet-search
- You only need dotnet-core runtime 2.1
- Install via
dotnet tool install --global dotnet-search
- Search via
dotnet search <package-name>
Unhandled Exception: Newtonsoft.Json.JsonReaderException: JSON integer 4645432572 is too large or small for an Int32. Path 'data[0].totalDownloads', line 1, position 1075.
–
Goingover A partial implementation of this feature now ships with .NET 8.0.2. While I don't see a way to list all available versions for a package, it can search for and show the most recent version, optionally including pre-release.
If you're looking to just check if a package exists, or check its latest version, you can use it like so:
dotnet package search <packageID>
The feature to list all versions may come at a later date, but this seems to be a good start.
Related github links:
warn : Failed to retrieve metadata from source ...
error. Other mechanisms are working correctly. –
Selfrespect You can do this with the nuget
CLI tool, like so: nuget list <package> -AllVersions
© 2022 - 2024 — McMap. All rights reserved.