NuGet Commands
.NET package manager.All NuGet pages
- Clear the NuGet cache: dotnet nuget locals all --cleardotnet nuget locals all --clear deletes the NuGet global packages folder, HTTP cache, temp and plugins caches. --list shows where they are; clear one at a time.
- dotnet add package --version: install a specific NuGet package versiondotnet add package Name --version 1.2.3 adds or changes a NuGet PackageReference. Version ranges and floating versions, prereleases, sources, CPM and errors.
- dotnet list package --outdated: find outdated NuGet packagesdotnet list package --outdated shows NuGet packages with newer versions: Requested, Resolved and Latest. Transitive, vulnerable, JSON output and how to update.
- dotnet pack: create a NuGet package (.nupkg) from a projectdotnet pack -c Release -o nupkgs builds a .nupkg from a project. Set PackageId, Version and metadata, override the version, symbols, and test before pushing.