Install NuGet client tools
Looking to install a package? See Ways to install NuGet packages.
To work with NuGet as a package consumer or creator, you can use command-line interface (CLI) tools and NuGet features in Visual Studio. This article briefly outlines the capabilities of the different tools, how to install them, and their comparative feature availability.
To get started using NuGet to consume packages, see the following articles:
To get started creating NuGet packages, see these articles:
- Create and publish a NET Standard package (dotnet CLI)
- Create and publish a NET Standard package (Visual Studio on Windows)
|dotnet SDK||The CLI tool for .NET Core and .NET Standard libraries, and for any SDK-style project such as one that targets the .NET Framework. This CLI tool is included with the .NET Core SDK and provides core NuGet features on all platforms. In Visual Studio 2017 and later, the dotnet CLI is automatically installed with any .NET Core related workloads.||.NET Core SDK|
|nuget.exe||The CLI tool for .NET Framework libraries and for any non-SDK-style project such as one that targets .NET Standard libraries. This CLI tool provides all NuGet capabilities on Windows and most features on Mac and Linux when running under Mono.||nuget.exe|
|Visual Studio||On Windows, the NuGet Package Manager is included with Visual Studio 2012 and later. Visual Studio provides the Package Manager UI and the Package Manager Console (PowerShell on Windows). You can use these tools to run most NuGet operations.||Visual Studio|
|Visual Studio for Mac||On Mac, certain NuGet capabilities are built in directly. Package Manager Console isn't currently available. For other capabilities, use the dotnet SDK or
||Visual Studio for Mac|
|Visual Studio Code||On Windows, Mac, and Linux, NuGet capabilities are available through marketplace extensions, or use the dotnet SDK or
||Visual Studio Code|
The MSBuild CLI also restores and creates packages. MSBuild isn't a general-purpose tool for working with NuGet. This CLI tool is primarily useful on build servers.
Package Manager Console commands work only within Visual Studio on Windows and don't work within other PowerShell environments.
In Visual Studio 2017 and later, the Visual Studio installer includes the NuGet Package Manager with any workload that employs .NET.
You can also install the Package Manager separately or verify your installation. Run the Visual Studio installer and check the option setting under Individual Components > Code tools > NuGet package manager. For more information, see Install and manage packages in Visual Studio by using the NuGet Package Manager.
For earlier versions of Visual Studio, you can download NuGet extensions at https://dist.nuget.org/index.html.
You can use either the dotnet CLI or the
nuget.exe CLI to support NuGet features in the Visual Studio IDE. The dotnet CLI is installed with some Visual Studio workloads, such as .NET Core. The
nuget.exe CLI must be installed separately as described earlier. For a feature comparison of the tools, see the feature availability section.
To target .NET Core or .NET Standard, use the dotnet SDK CLI tool. This CLI is required for the SDK-style project format, which uses the SDK attribute.
To target the .NET Framework (non-SDK-style project only), use the
nuget.exeCLI tool. If the project is migrated from
packages.configto PackageReference, use the dotnet SDK CLI tool instead.
The dotnet SDK is the .NET Core 2.0 CLI tool, which works on all platforms (Windows, Mac, and Linux) and provides core NuGet features such as installing, restoring, and publishing packages. The dotnet CLI provides direct integration with .NET Core project files (such as
.csproj), which is helpful in most scenarios. This CLI is also built directly for each platform and doesn't require installation of Mono.
Install the dotnet SDK
On developer computers, install the .NET Core SDK. In Visual Studio 2017 and later, the dotnet CLI is automatically installed with any .NET Core related workloads.
For build servers, follow the instructions to Use the .NET Core SDK and tools in continuous integration.
To learn how to use basic commands with the dotnet SDK CLI tool, see Install and manage NuGet packages with the dotnet CLI.
The NuGet CLI,
nuget.exe, is the command-line utility for Windows that provides all NuGet capabilities. This CLI can also run on Mac OSX and Linux by using Mono with some limitations.
To learn how to use basic commands with the
nuget.exe CLI tool, see Manage NuGet packages with the nuget.exe CLI.
Always install the latest version of the tool that supports your configuration.
- You can download the latest recommended version at
- If you already have the
nuget.exeCLI tool installed, you can update the tool to the latest version with the command
nuget update -self.
- For compatibility with older continuous integration systems, a previous URL,
https://nuget.org/nuget.execurrently provides the deprecated version 2.8.6 of the CLI tool.
Visit nuget.org/downloads and download NuGet version 3.3 or later.
- Version 5.0 and later requires the .NET Framework version 4.7.2 or later.
- Version 4.1.0 and later is required to publish packages to
- Version 2.8.6 isn't compatible with Mono.
Each download is the
nuget.exefile directly. Instruct your browser to save the file to a folder of your choice. The download file isn't an installer, so you don't see anything if you run the file directly from the browser.
To use the CLI tool from anywhere, add the folder location for the
nuget.exefile to your PATH environment variable.
The following table compares the available features for the dotnet and
nuget.exe CLI tools for supported platforms.
|Feature||dotnet CLI||nuget CLI (Windows)||nuget CLI (Mono)||Visual Studio (Windows)||Visual Studio for Mac|
|Install/uninstall packages||✔||✔ (1)||✔||✔||✔|
|Restore packages||✔||✔||✔ (2)||✔||✔|
|Manage package feeds (sources)||✔||✔||✔||✔|
|Manage packages on a feed||✔||✔||✔|
|Set API keys for feeds||✔||✔|
|Create packages (3)||✔||✔||✔ (4)||✔|
|Manage global-package and cache folders||✔||✔||✔|
|Manage NuGet configuration||✔||✔|
- (1) Doesn't affect project files. Use the dotnet SDK CLI tool instead.
- (2) Works only with
packages.configfile and not with solution (
- (3) Various advanced package features are available through the CLI only as they aren't represented in the Visual Studio UI tools.
- (4) Works with
.nuspecfiles but not with project files.
If you want to preview upcoming NuGet features, install a Visual Studio Preview, which works side-by-side with stable releases of Visual Studio. To report problems or share ideas for previews, open an issue on the NuGet GitHub repository.
- Install and manage packages by using Visual Studio
- Install and manage packages by using the dotnet CLI
- Install and manage packages by using the nuget.exe CLI
- Install and manage packages by using PowerShell
- Create a package by using the nuget.exe CLI
- Publish NuGet packages
- Package Manager Console PowerShell reference
Developers working on Windows can also explore the NuGet Package Explorer. This application is an open-source standalone tool that lets you visually explore, create, and edit NuGet packages. It's helpful for many scenarios, such as making experimental changes to a package structure without rebuilding the package.