How do I install a NuGet package into the second project in a solution?

There's 3 approaches :).
In NuGet 1.1 (The latest release) we've improved powershell pipelining so you can do this:

Get-Project -All | Install-Package SomePackage

That will install "SomePackage" into all of your projects. You can use wildcards to narrow down which projects:

Get-Project Mvc* | Install-Package SomePackage

That will use wildcard semantics (in this case, find all projects that start with mvc).

Get-Project SomeProject | Install-Package SomePackage

That will install SomePackage into SomeProject and nothing else.


There's two approaches.

As you already learned, the Package Manager Console has a drop down that lists the projects in your solution.

The other approach is to use the -Project flag. Nice thing about that is it gives you Intellisense with the project names! For example:

Install-Package SomePackage -Project MvcApplication2