Tuesday, April 15, 2014

Finding and Installing a NuGet Package Using the Package Manager Console

This topic describes how to find, install, remove, and update NuGet packages using PowerShell commands. You can also work with packages using the Manage NuGet Packages dialog box. For more information, see [Using the Manage NuGet Packages dialog](Using-the Add-Library-Package-Reference-Dialog-Box).
Using PowerShell commands is required if you want to install a package without having a solution open. It's also required in some cases for packages that create commands that you can access only by using PowerShell.

Finding a Package

From the Tools menuLibrary Package Manager and then click Package Manager Console.
, select





The two drop-down lists set default values that let you omit parameters from the commands you enter in the window:
  • In the Package source list, select the default source (NuGet package feed) that you want your commands to use. Typically you will leave this as its default value of NuGet official package source. For more information about alternative feeds, see Hosting Your Own NuGet Feeds.
  • In the Default project list, select the default project that you want your commands to work with. (The default value will be the first project in the solution, not necessarily the one you have selected in Solution Explorer when you open the window.)
When you enter commands, you can override these defaults. In the Package Manager Console window, enter Get-Package -ListAvailable at the prompt to see a list of all packages that are available in the selected package source.


Example :
 Get-Package -ListAvailable  ( This will return all the packages)

Get-Package -Filter Jquery  -ListAvailable   (This will return jquery available packages)

Install-Package  Jquery  << ProjectName>>


Refer the below screen for more information:






No comments:

Post a Comment