Saturday, 5 March 2016

Install , Update Nuget Package from Package Manager Console

Open Package Manager Console:


1. Goto Tools -> Library Package Manager >Package Manager Console

2. It'll open command line. 



Installing Package (Install-Package):


1. Use Install-Package command to install the package.(Installs on all projects of your solution)

     Install-Package Newtonsoft.Json

2. Install package to specific project

     Install-Package -ProjectName SampleWebAppAPI  Newtonsoft.Json


3. Installing specific Version of the package

     Install-Package  Newtonsoft.Json -Version 8.0.2

You can use the combination of the options

Update Package (Update-Package):


1. Update all Packages of all the Projects
    
     Update-Package 

2. Update specific package on all the projects 

     Update-Package Newtonsoft.Json

3. Update  package on all the projects to a specific version
     Update-Package Newtonsoft.Json -Version 8.0.2

4. Update Package of a specific project

     Update-Package -ProjectName SampleWebAppAPI Newtonsoft.Json

5. Reinstall the package and all its dependencies

     Update-Package  Newtonsoft.Json -reinstall



You can also use combination of options


Uninstall Package(Uninstall-Package)


1. Uninstall Package 

     Uninstall-Package  Microsoft.ASPNet.WebApi 




Please feel free to comment or contact me. 

Thank you.

No comments:

Post a Comment