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:
nuget.exe
CLI tools. 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 nuget.exe
CLI tools. 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.
Support policyThe Visual Studio for Windows support policy can be found at 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 on NuGet.exe's support policy, see the Microsoft Modern Lifecycle Policy.
The .NET SDK support policy can be found at .NET and .NET Core Support Policy.
Patch ReleasesPatched versions of NuGet.exe will be released exclusively when critical security fixes are required for a long-term support (LTS) version of Visual Studio or .NET SDK.
All security bugs should be reported to the Microsoft Security Response Center (MSRC) at MSRC's report page. Also, see the security policy in the NuGet.Client repo.
NuGet.exe unlistingOut-of-support, deprecated, or vulnerable NuGet.exe versions will be removed from tools.json.
Visual StudioIn 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.
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.exe
CLI tool. If the project is migrated from packages.config
to 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.
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.
nuget.exe CLIThe 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.
https://dist.nuget.org/win-x86-commandline/latest/nuget.exe
.nuget.exe
CLI tool installed, you can update the tool to the latest version with the command nuget update -self
.https://nuget.org/nuget.exe
currently provides the deprecated version 2.8.6 of the CLI tool.Visit nuget.org/downloads and download NuGet version 3.3 or later.
nuget.org
.Each download is the nuget.exe
file 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.exe
file to your PATH environment variable.
Behaviors can vary slightly based on your operating system distribution.
Install Mono version 4.4.2 or later.
Execute the following command at a shell prompt:
# Download the latest stable `nuget.exe` to `/usr/local/bin`
sudo curl -o /usr/local/bin/nuget.exe https://dist.nuget.org/win-x86-commandline/latest/nuget.exe
Create an alias by adding the following script to the appropriate file for your operating system (typically ~/.bash_aliases
or ~/.bash_profile
):
# Create as alias for nuget
alias nuget="mono /usr/local/bin/nuget.exe"
Reload the shell. Test the installation by entering the command nuget
with no parameters. NuGet CLI help should display.
The following table compares the available features for the dotnet and nuget.exe
CLI tools for supported platforms.
Feature notes
packages.config
file and not with solution (.sln
) files..nuspec
files 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.
Related articlesDevelopers 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.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4