NuGet – install all packages referenced by a project

When you install packages in a project using NuGet you probably don’t want to include those in your version control system. When you want to share some code in a blogpost you don’t want to include all the dlls that are referenced by your project since people can install the packages through NuGet.

When you install a package though a file gets added called packages.config containing all information needed by NuGet to find it in the repositories. There’s no out of the box solution though all the hooks are in place. You need to install the package called “NuGet.CommandLine”.

This allows you to issue the nuget command which lets you refer to the packages.config file. Then use your package console manager to issue the following command: “nuget i PathToConfig -o Packages”.

You’ll see all your packages fly by. You can find more info over here.

One Reply to “NuGet – install all packages referenced by a project”

  1. This is by far one of the best posts I’ve seen. Saved me in a pinch, I use an SVN system that has limited space, so publishing all of my externals was eating it up. Now I don’t have to do that anymore because I can just synchronize with this.

    I really hope this becomes a native feature of NuGet in a future release.

Leave a Reply

Your email address will not be published. Required fields are marked *