Binary Worrier
Binary Worrier

Reputation: 51709

NuGet : How to keep package versions consistent across several solutions?

We're building a set of several services, each service has it's own solution with associated projects. Many of these services rely on the same NuGet packages.
All the solutions have "Package Restore" enabled.

Some of the solutions refer to assemblies owned by other solutions, this is one obvious reason why we need all the solutions to refer to exactly the same versions of different NuGet Packages.

All of the services need to work together to achieve an end result. They're packaged and installed as part of a single product, which is another reason we'd like everything to be running off the same versions of the NuGet Packages

We're having trouble keeping package versions consistent between Solutions.

Currently we're manually checking and updating package versions, we're also getting occasional compilation errors because projects in one solution end up referring to different versions of the same package.

Is there a recommended way of doing this (hopefully an automatic process)?
Would we be better off without Package Restore?
Anyone have any general advice on the subject?

Thanks

Update: I created an issue for this on the NugGet project http://nuget.codeplex.com/workitem/2623

Upvotes: 14

Views: 2215

Answers (2)

Danny Varod
Danny Varod

Reputation: 18069

You could configure your TFS builds to update all NuGet packages in the solution to their latest versions using the nuget update command.

The latest versions could be from nuget.org, a local NuGet server or even a network share. Use the source parameter to define the sources you want to update from.

You can perform the build configuration via MsBuild proj files or via a TFS template.

Upvotes: 0

akton
akton

Reputation: 14376

To solve this:

  1. Create your own private NuGet server (see 1 and 2) that hosts the correct versions of the packages you use.
  2. Configure each build system to use that server and auto update to the latest version.

Although this requires a server, it not only ensures everyone has the correct version but speeds up the downloads for build servers as well.

Upvotes: 5

Related Questions