NuGet CLI update command (original) (raw)

Applies to: package consumption • Supported versions: all

Updates all packages in a project (using packages.config) to their latest available versions. It is recommended to run 'restore' before running the update. (To update an individual package, use nuget install without specifying a version number, in which case NuGet installs the latest version.)

Note: update does not work with the CLI running under Mono (Mac OSX or Linux) or when using the PackageReference format.

The update command also updates assembly references in the project file, provided those references already exist. If an updated package has an added assembly, a new reference is not added. New package dependencies also don't have their assembly references added. To include these operations as part of an update, update the package in Visual Studio using the Package Manager UI or the Package Manager Console.

This command can also be used to update nuget.exe itself using the -self flag.

Usage

nuget update <configPath> [options]

where <configPath> identifies either a packages.config or solution file that lists the project's dependencies.

Options

Also see Environment variables

Examples

nuget update

# update packages installed in solution.sln, using MSBuild version 14.0 to load the solution and its project(s).
nuget update solution.sln -MSBuildVersion 14

nuget update -safe

nuget update -self