You can list all the Nuget packages installed with the "dotnet list packages" command:
dotnet list package
To see only the outdated packages, use the --outdated option:
dotnet list package --outdated
Append the "--include-prerelease" option to consider prerelease versions:
dotnet list package --include-prerelease
To add a new package, use the "dotnet add package" command:
dotnet add package <package_name>
It automatically installs the latest version of the package, but if you need a specific version of a package, append the -v or --version switch to the command:
dotnet add package <package_name> -v <version>
Sometimes you need to specify the source of the Nuget package:
dotnet add package <package_name> --source https://api.nuget.org/v3/index.json
To update a Nuget package, use the "dotnet add package" as well.
dotnet add package <package_name>
The "dotnet run" and "dotnet build" commands automatically restores packages, but if you want explicitly restore them use the "dotnet restore" command:
dotnet restore
dotnet remove package <package_name>
There are some extensions that allows you to manage the Nuget packages directly from Visual Studio Code. I use this one: NuGet Package Manager GUI
Among many features, it allows you to add, update and remove multiple packages at once.
You can install it from the VS Code Marketplace NuGet Package Manager GUI.
To use it, open the Command Palette (Ctrl+Shift+P
on Windows or Command+Shift+P
on Mac) and then select > NuGet Package Manager GUI
To update all packages: