Downgrade Package not working as described

Topics: General
Feb 11, 2015 at 6:17 PM
Downgrade Package
It is not uncommon to install a prerelease version of a package in order to investigate new features and then decide to roll back to the last stable version. Prior to NuGet 2.8, this was a multi-step process of uninstalling the prerelease package and its dependencies, and then installing the earlier version. With NuGet 2.8, however, the update-package will now roll back the entire package closure (e.g. the package's dependency tree) to the previous version.
However, what actually happens is that the code looks at both the flag AND my installed package version. If either of those is Prerelease, it includes prerelease packages in the update. That is, basically, the exact opposite of the feature as described.

In the code at the method UpdatePackages contains this:
                            // If the user explicitly allows prerelease or if the package being updated is prerelease we'll include prerelease versions in our list of packages
                            // being considered for an update.
                            bool allowPrerelease = Prerelease || !package.IsReleaseVersion();
What I need is the feature as-described - the ability to install an unstable/prerelease version of a package with the -Prerelease flag, then, after testing things, downgrade to the stable version with the exact same command, less the -Prerelease flag.

We're using the Nuget.exe command-line bootstrapper against project-level packages.config files. I thought this was working yesterday, but it appears that I either didn't fully test it or something changed between yesterday morning and yesterday afternoon.

Have I misunderstood this feature?
Feb 18, 2015 at 3:34 PM
Should I enter this as an Issue?