Multiple Versions in Packages.config

Apr 27, 2012 at 2:52 PM

We use Nuget in Continuous Integration environment where packages are rapidly changing. When developers check in to proj and and packages.config files, we sometimes get multi versions listed in the packages.config file.

For example:

Instead of: 


<package id="MyPackage" version="1" />



we get:


  <package id="MyPackage" version="1" />

<package id="MyPackage" version="2" />



The project file references one of these version. When we go to build on out CI, the build breaks because it can't find the reference to "MyPackage". If I remove the line in the packages.config file for the version that is NOT listed in the project file, the build goes through.

We use the nuget command to handle package updates. Our workflow is:

  1. nuget install on each project - installs packages listed in packages.config
  2. nuget update on solution - update packages.config/proj files to latest packages
  3. nuget install on each project- install any updated packages
  4. Developer checks in any changes to packages.config and proj files

This is a fairly annoying problem that happens daily for us.

Unfortunately, I have not definitively nailed down a process to recreate the issue reliably. All I can think of is that it has something to do with our packages updating frequently.

For example, while the developer is running the above package update steps, one of the packages get updated. It seems like the nuget update is searching for the latest version on each individual project and not capturing the same versions for the entire solution. So if a package updates while nuget is updating the solution, we can have different versions of the same package among the projects in the solution.


Any thoughts on the issue?