Skip to content

Instantly share code, notes, and snippets.

@asd123ea
Forked from rafaelune/NuGet_Commands.md
Last active June 20, 2017 14:54
Show Gist options
  • Save asd123ea/67288e02450ee4e0037c to your computer and use it in GitHub Desktop.
Save asd123ea/67288e02450ee4e0037c to your computer and use it in GitHub Desktop.
NuGet basic commands

NuGet Basic Commands

Package Manager Console

List all available packages of a source.

  PM> Get-Package -ListAvailable

Install an older version of package

  PM> Install-Package Newtonsoft.Json -Version <press tab key for autocomplete>

Find the "jquery" on the list of available packages of a source.

  PM> Get-Package -ListAvailable -Filter jquery

List all recent installed packages.

  PM> Get-Package -Recent

To install a package

  PM> Install-Package jquery

List all installed packages.

  PM> Get-Package

Remove an installed package.

  PM> Uninstall-Package jquery

Checks for installed packages updates.

  PM> Get-Package -Updates

Update package to a specific version

  PM> Update-Package jquery -Version 1.1.0

Creating and Publishing Packages

** IMPORTANT: Remember to set nuget.exe to your %PATH% or it won't work. **

Create a package of your project.

  $ nuget pack MyProject.csproj

Publish your package.

  $ nuget push MyProject.1.0.0.0.nupkg -s http://yournugethost/{yourapikey}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment