Installing 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 cross-platform command-line interface (CLI) tools as well as NuGet features in Visual Studio. This article briefly outlines the capabilities of the different tools, how to install them, and their comparative feature availability.
|dotnet.exe||Included with the .NET Core SDK and provides core NuGet features on all platforms.||.NET Core SDK|
|nuget.exe||Provides all NuGet capabilities on Windows and most features running under Mono on Mac and Linux.||nuget.exe|
|Visual Studio||Provides NuGet capabilities through the Package Manager UI and Package Manager Console; included with .NET-related workloads.||Visual Studio 2017|
The MSBuild CLI also provides the ability to restore and create packages, which is primarily useful on build servers. MSBuild is not otherwise a general-purpose tool for working with NuGet.
The two NuGet CLI tools are
nuget.exe. See feature availability for a comparison.
The .NET Core 2.0 CLI,
dotnet.exe, works on all platforms (Windows, Mac, and Linux) and provides core NuGet features, such as installing, restoring, and publishing packages. 'dotnet' provides direct integration with .NET Core project files (such as
.csproj), which is helpful in most scenarios.
dotnet is also built directly for each platform and does not require you to install Mono.
- On developer computers, install the .NET Core SDK.
- For build servers, follow the instructions on Using .NET Core SDK and tools in Continuous Integration.
For more information, see .NET Core command-line interface tools.
The NuGet CLI,
nuget.exe, is the command-line utility for Windows that provides all NuGet capabilities; it can also be run on Mac OSX and Linux using Mono with some limitations. Unlike
nuget.exe CLI does not affect project files.
- On Mac and Linux, install Mono 4.4.2 or later.
- Visit nuget.org/downloads and select NuGet 3.3 or higher (2.8.6 is not compatible with Mono). The latest version is always recommended, and 4.1.0+ is required to publish packages to nuget.org.
- Each download is the
nuget.exefile directly. Instruct your browser to save the file to a folder of your choice. The file is not an installer; you won't see anything if you run it directly from the browser.
- Add the folder where you placed
nuget.exeto your PATH environment variable to use the CLI tool from anywhere.
nuget update -self to update an existing nuget.exe to the latest version.
The latest recommended NuGet CLI is always available at
https://dist.nuget.org/win-x86-commandline/latest/nuget.exe. For compatibility purposes with older continuous integration systems, a previous URL,
https://nuget.org/nuget.exe currently provides the 2.8.6 CLI tool. This is deprecated.
- Visual Studio Code: NuGet capabilities are available through marketplace extensions, or use the
Visual Studio for Mac: certain NuGet capabilities are built in directly. See Including a NuGet package in your project for a walkthrough. For other capabilities, use the
Visual Studio on Windows: The NuGet Package Manager is included with Visual Studio 2012 and later. The Package Manager provides the Package Manager UI and the Package Manager Console, through which you can run most NuGet operations.
- The Visual Studio 2017 installer includes the NuGet Package Manager with any workload that employs .NET. To install separately, or to verify that the Package Manager is installed, run the Visual Studio 2017 installer and check the option under Individual Components > Code tools > NuGet package manager.
- The Package Manager UI and Console are unique to Visual Studio on Windows. They are not available on Visual Studio for Mac at present.
- Visual Studio does not automatically include the
nuget.exeCLI, which must be installed separately as described earlier.
- Package Manager Console commands work only within Visual Studio on Windows and not within other PowerShell environments.
- For Visual Studio 2010 and earlier, install the "NuGet Package Manager for Visual Studio" extension.
- NuGet Extensions for Visual Studio 2013 and 2015 can also be downloaded from https://dist.nuget.org/index.html.
- If you'd like to preview upcoming NuGet features, install the Visual Studio 2017 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.
|Feature||dotnet CLI||nuget CLI (Windows)||nuget CLI (Mono)||Visual Studio (Windows)||Visual Studio for Mac|
|Manage package feeds (sources)||✔||✔||✔||✔|
|Manage packages on a feed||✔(1)||✔||✔|
|Set API keys for feeds||✔||✔|
|Manage the NuGet cache||✔||✔||✔|
|Manage NuGet configuration||✔||✔|
(1) Packages on nuget.org only
(2) Does not affect project files; use
(3) Works only with
packages.config file and not with solution (
(4) Various advanced package features are available through the CLI only as they aren't represented in the Visual Studio UI tools.
(5) Works with
.nuspec files but not with project files.
- dotnet commands
- NuGet CLI reference
- Package Manager UI reference
- Package Manager Console reference
- Package Manager Console PowerShell reference
- Creating a package
- Publishing a Package
Developers working on Windows can also explore the NuGet Package Explorer, an open-source, stand-alone tool to visually explore, create, and edit NuGet packages. It's very helpful, for example, to make experimental changes to a package structure without rebuilding the package.