-Pre has a bad side-effect

Topics: General
Feb 16, 2013 at 6:50 PM
Whenever I have a pre-release package I would like people to test, I would like to be able to put it up on NuGet and let people install it from there.

The problem is that when you use the -Pre switch, that doesn't just mean pre-release for the actual installed package, it also means -Pre for all packages the main package depends on.

Right now my package depends on a few packages, and some of these depend on a few, so it would be quite a task to manually install everything (using -IgnoreDependencies). Right now my (pre-release) package breaks when installed from NuGet because a pre-release version of Ninject gets installed. When running with the stable version of Ninject, everything works (well,most!).

I hope you understand the problem I face?
Feb 16, 2013 at 6:55 PM
I guess a new switch for Install-Package and Update-Package could fix this, e.g. -StableDependencies, and perhaps a GUI equivalent.
Feb 17, 2013 at 7:07 AM
+1 for the suggestion of @adamralph: it gives more control over what pre-releases the consumer wants or allows, without affecting the current workings (e.g. package restore without the new -StableDependencies switch)
Feb 19, 2013 at 7:20 AM
Sorry, but I don't get it. Your main package depends on other pre-packages and then you wonder that those will be installed too? Why don't you depend on the regular packages instead? If your package depends on new pre-features then it's alright to install them too.
Feb 19, 2013 at 7:27 AM
SomebodyYouKnow wrote:
Why don't you depend on the regular packages instead?
I think that's exactly what he's doing, but because his own package is a pre-release, consumers need to install his package with the -pre switch.
This seems to have the side-effect of also downloading pre-release dependencies if they are available, even though the actual package being installed is not depending on any pre-releases.

@steentottrup: how do you define your package dependencies in the nuspec? Are you using any version constraints? or do you leave the defaults of >= for dependency resolution?
Feb 19, 2013 at 8:26 AM
Thank you xavierdecoster, that makes it more clear to me (and perhaps others who were confused). :)
Feb 19, 2013 at 9:33 AM
Spot on, my package is in pre-release state, and what I don't need, is pre-release versions of the packages my package depends on!
@steentottrup: how do you define your package dependencies in the nuspec? Are you using any version constraints? or do you leave the defaults of >= for dependency resolution?
I have both types, constraints to a particular version and the default >=. It's probably the last that is breaking things right now for me.