To check if nuget.exe is already in your system's PATH: If nuget.exe was located on your PC at "C:\My Utilities\nuget.exe", to add nuget.exe to your PATH:
Install-Package NuGet.CommandLine Related
Skip to main content This browser is no longer supported. Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
In this article
To work with NuGet, as a package consumer or creator, you can use 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. To get started using NuGet to consume packages, see Install and use a package (dotnet CLI) and Install and use a package (Visual Studio). To get started creating NuGet packages, see Create and publish a NET Standard package (dotnet CLI) and Create and publish a NET Standard package (Visual Studio).
The MSBuild CLI also provides the ability to restore and create packages, which is primarily useful on build servers. MSBuild is not a general-purpose tool for working with NuGet. Package Manager Console commands work only within Visual Studio on Windows and do not work within other PowerShell environments. Visual StudioInstall on Visual Studio 2017 and newerStarting in Visual Studio 2017, the 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 installer and check the option under Individual Components > Code tools > NuGet package manager. Install on Visual Studio 2015 and olderNuGet Extensions for Visual Studio 2013 and 2015 can be downloaded from https://dist.nuget.org/index.html. For Visual Studio 2010 and earlier, install the "NuGet Package Manager for Visual Studio" extension. Note, if you can't see the extension in the first page of search results, try changing the Sort By dropdown to "Most Downloads", or an alphabetical sort. You can use either the dotnet CLI or the nuget.exe CLI to support NuGet features in the 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. The two NuGet CLI tools are dotnet.exe and nuget.exe. See feature availability for a comparison.
dotnet.exe CLIThe .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. Installation:
To learn how to use basic commands with the dotnet CLI, see Install and use packages using the dotnet CLI. nuget.exe CLIThe nuget.exe 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. To learn how to use basic commands with the nuget.exe CLI, see Install and use packages using the nuget.exe CLI. Installation: WindowsNote NuGet.exe 5.0 and later require .NET Framework 4.7.2 or later to execute.
macOS/LinuxBehaviors may vary slightly by OS distribution.
Tip Use nuget update -self on Windows to update an existing nuget.exe to the latest version. Note 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 deprecated 2.8.6 CLI tool. Feature availability
(1) Does not affect project files; use dotnet.exe instead. (2) Works only with packages.config file and not with solution (.sln) files. (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 .nuspec files but not with project files. Upcoming FeaturesIf you'd like 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 topics
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. FeedbackSubmit and view feedback for How do you set the local path of NuGet EXE to your path environment variable?Click “Advanced System Settings” then click the “Environment Variables” button located within the Advanced tab. From here double-click the PATH variable in the top panel and create a new entry by adding the path to the directory that contains your NuGet.exe file (in this instance it's C:/NuGet/).
How do I install NuGet EXE on Windows?Windows. Visit nuget.org/downloads and select NuGet 3.3 or higher (2.8. 6 is not compatible with Mono). ... . Each download is the nuget.exe file directly. ... . Add the folder where you placed nuget.exe to your PATH environment variable to use the CLI tool from anywhere.. Is not recognized as an internal or external command operable program or batch file?You can resolve this issue in three ways: First, use the full path of the executable file to launch the program. Second, add the program path to Windows environment variables. Finally, move the files to the System32 folder.
How do I know if NuGet EXE is installed?In Visual Studio, use the Help > About Microsoft Visual Studio command and look at the version displayed next to NuGet Package Manager. Alternatively, launch the Package Manager Console (Tools > NuGet Package Manager > Package Manager Console) and enter $host to see information about NuGet including the version.
|