Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Package Manager Console - Update a specific project

Quick question regarding the Package Manager Console and the “Update Package” command.

I currently have a single solution hosting two MVC 4.0 projects (one of them is Set as Startup Project).

When I open the Package Manager Console, I choose the project I want to update from the Default project dropdown and then, I launch the “Update-Package” command.

To my surprise, the “Update-Package” command does not take into account the project I have selected inside the Default project dropdown but instead, it updates both my MVC 4.0 projects.

The workaround is to manually specify my project name inside the “Update-Package” command like so: Update-Package -ProjectName Kobo.Portal.Web

Out of curiosity, does anyone know why the Update-Package command does not take into account the selected/targeted project in the Default project dropdown?

Is this a known issue? Is this by design? What’s the purpose of having to choose a Default project if the Package Manager Console won’t take it into account?

Perhaps my understanding of the Package Manager Console is wrong :-(

Thanks in advance for anyone shedding some light on this.

Sincerely Vince

like image 425
Vlince Avatar asked Apr 22 '13 13:04

Vlince


People also ask

How do I select a project in Package Manager console?

Select the Tools > NuGet Package Manager > Package Manager Console menu command. Once the console opens, check that the Default project drop-down list shows the project into which you want to install the package. If you have a single project in the solution, it is already selected.

How do I Update NuGet package references?

Update a package. In Solution Explorer, right-click either References or the desired project, and select Manage NuGet Packages.... (In web site projects, right-click the Bin folder.) Select the Updates tab to see packages that have available updates from the selected package sources.

How do I use package manager console?

Open your project or solution in Visual Studio, and then open the Package Manager Console in Visual Studio by navigating to Tools > NuGet Package Manager > Package Manager Console. By default, console commands operate against a specific package source and project as set in the control at the top of the window.


1 Answers

To update a specific project you can specify

Update-Package -ProjectName <yourproject>

To get detailed help on the commands in the Package Management console you can type

get-help update-package -detailed
like image 149
Filip De Vos Avatar answered Sep 20 '22 13:09

Filip De Vos