Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 484
Binary Worrier Avatar asked Sep 19 '12 10:09

Binary Worrier


People also ask

Does NuGet package include dependencies?

Any time a package is installed or reinstalled, which includes being installed as part of a restore process, NuGet also installs any additional packages on which that first package depends. Those immediate dependencies might then also have dependencies on their own, which can continue to an arbitrary depth.

What is Nupkg package?

Put simply, a NuGet package is a single ZIP file with the . nupkg extension that contains compiled code (DLLs), other files related to that code, and a descriptive manifest that includes information like the package's version number.


1 Answers

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.

like image 143
akton Avatar answered Oct 20 '22 10:10

akton