How to use NuGet Commandline

What is Nuget

Nuget is an open source package manager for the Microsoft development platform including .NET. The NuGet client tools provide the ability to produce and consume packages. The NuGet Gallery is the central package repository used by all package authors and consumers.

Downloading NuGet

Configuring NuGet

Before installing any package, you’ll need to specify the package folder.

Nuget Config -Set repositoryPath="Path"

Optionally you can add ‘-ConfigFile “configFile”‘ to any command to useĀ a different configfile.

Listing available packages

Nuget List [searchTerm]

Installing a package

Nuget install "packagename"

optionally you can install a specific version of a package by adding the ‘-version’ option.

nuget install "packagename" -version x.y

Installing packages from a packages.config files

nuget restore

this command expects that a packages.config is available in the current directory.

Leave a Reply