Quick and dirty cheat sheet for NuGet commands. All commands should be run in the Visual Studio Package Manager Console window.
Most commands assume that:
- You are in the base directory of the solution (where your .sln file is).
- You have selected the correct Package Source (All is recommended).
- You have selected the correct Default project.
Install-Package Newtonsoft.Json
Install-Package Newtonsoft.Json -IncludePrerelease
Install-Package Newtonsoft.Json -Version 6.0.1
# Reinstall and fixes references to all packages in solution
Update-Package -Reinstall
# Reinstall and fixes references to a single package
Update-Package -Id Newtonsoft.Json –Reinstall
# Updates all packages in all projects in the solution to latest version
# Based on hard experience: Only do this if really sure what you are doing.
Update-Package
# Updates single package to latest version
Update-Package Newtonsoft.Json