NuGet for solutions with multiple projects

Solution 1:

For anybody stumbling across this, now there is the following option :

Right-click your solution > Manage NuGet Packages for Solution...

... Or:

Tools > Library Package Manager > Manage NuGet Packages for Solution...

And if you go to the Installed packages area you can 'Manage' a single package across every project in the solution.

Solution 2:

Use the console to target multiple projects

Tools > Library Package Manager > Package Manager Console

then use this command

Get-Project PROJECT-NAMES-WITH-COMMAS | Install-Package PACKAGENAME

for example

Get-Project Core,UI | Install-Package FluentDateTime

Solution 3:

This sweet deal works for me:

PM> Get-Project -all | where {$_.Name -match "Songhay.Silverlight" -and
    $_.Name -notmatch "ApplicationLoader" -and $_.Name -notmatch ".Xml"}
    | ForEach-Object {Install-Package MvvmLight -project $_.Name}

Solution 4:

If you want to install a package across multiple solutions I wrote a handy Powershell script for doing it, see here.

You can even filter the Get-Project -All command and target a sub-set of the project list.

Solution 5:

You should use the "Add Library Package Reference" for all your external library on every project in your solution. You'll end up with a packages.config per project.

However, you'll download the package only one time and reuse them locally for all your other projects.