NuGet packaging system
Uninstalling a package from one project in a solution
Section titled “Uninstalling a package from one project in a solution”PM> Uninstall-Package -ProjectName MyProjectB EntityFrameworkInstalling a specific version of a package
Section titled “Installing a specific version of a package”PM> Install-Package EntityFramework -Version 6.1.2Installing the NuGet Package Manager
Section titled “Installing the NuGet Package Manager”In order to be able to manage your projects’ packages, you need the NuGet Package Manager. This is a Visual Studio Extension, explained in the official docs: Installing and Updating NuGet Client.
Starting with Visual Studio 2012, NuGet is included in every edition, and can be used from: Tools -> NuGet Package Manager -> Package Manager Console.
You do so through the Tools menu of Visual Studio, clicking Extensions and Updates:
This installs both the GUI:
- Available through clicking “Manage NuGet Packages…” on a project or its References folder
And the Package Manager Console:
- Tools -> NuGet Package Manager -> Package Manager Console.
Adding a package source feed (MyGet, Klondike, ect)
Section titled “Adding a package source feed (MyGet, Klondike, ect)”nuget sources add -name feedname -source http://sourcefeedurlManaging Packages through the UI
Section titled “Managing Packages through the UI”When you right-click a project (or its References folder), you can click the “Manage NuGet Packages…” option. This shows the Package Manager Dialog.
Managing Packages through the console
Section titled “Managing Packages through the console”Click the menus Tools -> NuGet Package Manager -> Package Manager Console to show the console in your IDE. Official documentation here.
Here you can issue, amongst others, install-package commands which installs the entered package into the currently selected “Default project”:
Install-Package ElmahYou can also provide the project to install the package to, overriding the selected project in the “Default project” dropdown:
Install-Package Elmah -ProjectName MyFirstWebsiteUpdating a package
Section titled “Updating a package”To update a package use the following command:
PM> Update-Package EntityFrameworkwhere EntityFramework is the name of the package to be updated. Note that update will run for all projects, and so is different from Install-Package EntityFramework which would install to “Default project” only.
You can also specify a single project explicitly:
PM> Update-Package EntityFramework -ProjectName MyFirstWebsiteUninstalling a package
Section titled “Uninstalling a package”PM> Uninstall-Package EntityFrameworkuninstall a specific version of package
Section titled “uninstall a specific version of package”PM> uninstall-Package EntityFramework -Version 6.1.2Using different (local) Nuget package sources using UI
Section titled “Using different (local) Nuget package sources using UI”It is common for company to set up it’s own nuget server for distribution of packages across different teams.
- Go to Solution Explorer and click Right Mouse button then choose
Manage NuGet Packages for Solution
- In window that opens click on
Settings
- Click on
+in top right corner then add name and url that points to your local nuget server.
Remarks
Section titled “Remarks”NuGet is the 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.
Images in examples courtesy of NuGet.org.




