Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Looking to install a package? See Ways to install a NuGet package.
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 various tools. It also explains how to install them and compares the availability of features across the tools.
NuGet quickstarts
To get started using NuGet to consume packages, see the following articles:
- Install and use a package with the dotnet CLI
- Install and use a NuGet package in Visual Studio (Windows only)
To get started creating NuGet packages, see these articles:
- Create and publish a package with the dotnet CLI
- Create and publish a NuGet package using Visual Studio (Windows only)
Tools overview
| Tool | Description | Download |
|---|---|---|
| dotnet SDK | The CLI tool for .NET 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 SDK and provides core NuGet features on all platforms. In Visual Studio 2017 and later, the dotnet CLI is automatically installed with any .NET-related workloads. | .NET 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 macOS and Linux when running under Mono. | nuget.exe |
| Visual Studio | A full-fledged integrated development environment (IDE) that includes NuGet Package Manager. 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 Code | A lightweight, open-source code editor for Windows, macOS, and Linux that offers NuGet capabilities through marketplace extensions. You can also use the dotnet SDK or nuget.exe CLI tools from within Visual Studio Code. |
Visual Studio Code |
You can also use the Microsoft Build Engine (MSBuild) CLI to restore and create packages. But 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.
Support policy
For the Visual Studio for Windows support policy, see Visual Studio Product Lifecycle and Servicing.
The most recent version of nuget.exe is fully supported and can be relied on for bug fixes, updates, and enhancements.
For more information about the nuget.exe support policy, see Modern Lifecycle Policy.
For the .NET SDK support policy, see .NET and .NET Core Support Policy.
Patch releases
Patched versions of nuget.exe are released exclusively when critical security fixes are required for a long-term support (LTS) version of Visual Studio or the .NET SDK.
All security bugs should be reported to the Microsoft Security Response Center (MSRC) at the MSRC report page. For detailed information about reporting security issues, see the security policy in the NuGet.Client repo.
NuGet.exe unlisting
Out-of-support, deprecated, or vulnerable nuget.exe versions are removed from the tools.json endpoint.
Visual Studio
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 using the NuGet Package Manager.
CLI tools
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. 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 or .NET Standard, use the dotnet SDK CLI tool. This CLI is required for the SDK-style project format, which uses the
SDKattribute.To target .NET Framework (non-SDK-style projects only), use the
nuget.exeCLI tool. If the project is migrated from thepackages.configformat toPackageReference, use the dotnet SDK CLI tool instead.
dotnet SDK
The dotnet SDK is the .NET CLI tool. It works on all platforms (Windows, macOS, and Linux) and provides core NuGet features such as installing, restoring, and publishing packages. The dotnet CLI provides direct integration with .NET project files, such as .csproj files, 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 SDK. In Visual Studio 2017 and later, the dotnet CLI is automatically installed with any .NET-related workloads.
For build servers, follow the instructions to use the .NET SDK in continuous integration (CI) environments.
To find out how to use basic commands with the dotnet SDK CLI tool, see Install and manage NuGet packages with the dotnet CLI.
nuget.exe CLI
The NuGet CLI, nuget.exe, is the command-line utility for Windows that provides all NuGet capabilities. This CLI can also run on macOS and Linux by using Mono with some limitations.
To find out how to use basic commands with the nuget.exe CLI tool, see Manage NuGet packages with the nuget.exe CLI.
Install nuget.exe
Always install the latest version of the tool that supports your configuration.
If the nuget.exe CLI tool is already installed, you can update the tool to the latest version by using the command nuget update -self.
Download
nuget.exe:- To download the latest recommended version, go to https://dist.nuget.org/win-x86-commandline/latest/nuget.exe.
- To download the deprecated version 2.8.6, to maintain compatibility with older continuous integration systems, go to https://dist.nuget.org/win-x86-commandline/v2.8.6/nuget.exe. Version 2.8.6 isn't compatible with Mono.
- To select a version to download, go to nuget.org/downloads.
- Version 5.0 and later require .NET Framework 4.7.2 or later.
- Version 4.1.0 or later is required to publish packages to nuget.org.
When prompted, save the file to a folder of your choice. The nuget.exe file is downloaded directly. The downloaded file isn't an installer, so there's no need to run the file directly from the browser.
To use the CLI tool from any folder, add the folder that contains the nuget.exe file to your
PATHenvironment variable.
Feature availability
The following table compares the available features for the dotnet CLI, nuget.exe CLI, and Visual Studio tools for supported platforms.
| Feature | dotnet CLI | nuget CLI (Windows) | nuget CLI (Mono) | Visual Studio |
|---|---|---|---|---|
| Search packages | ✔ | ✔ | ✔ | ✔ |
| Install or uninstall packages | ✔ | ✔ (1) | ✔ | ✔ |
| Update packages | ✔ | ✔ | ✔ | |
| Restore packages | ✔ | ✔ | ✔ (2) | ✔ |
| Manage package feeds (sources) | ✔ | ✔ | ✔ | ✔ |
| Manage packages on a feed | ✔ | ✔ | ✔ | |
| Set API keys for feeds | ✔ | ✔ | ||
| Create packages (3) | ✔ | ✔ | ✔ (4) | ✔ |
| Publish packages | ✔ | ✔ | ✔ | ✔ |
| Replicate packages | ✔ | ✔ | ||
| Manage global-packages and cache folders | ✔ | ✔ | ✔ | |
| Manage NuGet configuration | ✔ | ✔ | ✔ |
Feature notes:
- (1) Using this feature doesn't affect project files. Use the dotnet SDK CLI tool instead.
- (2) This feature works only with packages.config files and not with solution (.sln or .slnx) files.
- (3) Various advanced package features are available through the CLI only, because they aren't represented in the Visual Studio UI tools.
- (4) This feature works with .nuspec files but not with project files.
Upcoming features
If you want to preview upcoming NuGet features, install the Insiders Channel version of Visual Studio, 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.
Related content
- Install and manage packages in Visual Studio using the NuGet Package Manager
- Install and manage NuGet packages with the dotnet CLI
- Manage NuGet packages with the NuGet CLI
- Manage packages with the Visual Studio Package Manager Console (PowerShell)
- Create a package using the nuget.exe CLI
- Publish NuGet packages
- Package Manager Console PowerShell reference
Developers who work on Windows can also explore the NuGet Package Explorer. This application is an open-source standalone tool that you can use to 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.