Single Package Version per Solution

Not too long ago, I posted a survey on my blog asking a set of questions meant to gather information that would help the NuGet team make a decision about a rather deep change.

You can see the results of the survey here.

If there’s one question that got to the heart of the matter, it’s this one.

survey-question-result

We’re considering a feature that would only allow a single package version per solution. As you can see by the response to the question, that would fit what most people need just fine, though there are a small number of folks that might run into problems with this behavior.

One variant of this idea would allow multiple package versions if the package doesn’t contain any assemblies (for example, a JavaScript package like jQuery).

Thanks again for filling out the survey. We think we have a pretty good idea of how to proceed at this point, but there’s always room for more feedback. If you want to provide more feedback on this proposed change, please review the spec here and post your thoughts in our discussion forum in the thread dedicated to this change.

The spec describes what pain point we’re trying to solve and shows a few examples of how the behavior change would affect common scenarios, so it’s worth taking a look at.

What others have said

Requesting Gravatar... Alexander DiMauro May 02, 2011 10:03 PM
# re: Single Package Version per Solution
One of the features of NuGet is that, if a package depends on another, it automatically downloads all the dependencies. But, an issue I ran into was when a package has a dependency on an older version of another package.

One example is NUnit.Should. I installed it, and it also installed NUnit, its dependency. But, it installed the latest version (2.5.10), not the version it depends on (2.5.9). I had to uninstall 2.5.10, then go back and install 2.5.9.10348 to get it to work.

Shouldn't there be a way to tag the correct version of a dependency so NuGet will get that one instead of the latest?
Requesting Gravatar... haacked May 03, 2011 2:05 PM
# re: Single Package Version per Solution
A package can define an exact match. But typically they don't. By default, when you specify version="1.0", you're specifying a min version.
Requesting Gravatar... Claire May 04, 2011 11:29 PM
# re: Single Package Version per Solution
I'm trying to think of a plausible instance during which I'd need different versions of an assembly within a single solution, and I really can't think of one. I guess it depends on what you want to do, but I think your idea of idea allowing multiple package versions if the package doesn’t contain any assemblies seems like a safe way to play it. I'm excited to use the end result!
Requesting Gravatar... Matt May 06, 2011 12:36 AM
# re: Single Package Version per Solution
I was talking with a fellow dev yesterday about this and we agreed that the ability to add a single dependency to an entire solution would simplify things greatly. This would encourage NuGet adoption ever further.

Thanks for the post on this!

What do you have to say?

(will show your gravatar)
Please add 2 and 7 and type the answer here: