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
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.
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.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With