Quantcast
Channel: WE MOVED to github.com/nuget. This site is not monitored!
Viewing all articles
Browse latest Browse all 7612

Commented Unassigned: Set "allowedVersions" from command line and easier downgrade [3587]

$
0
0
With the amount of changes in javascript libraries for the "evergreen" browsers, it is more required than ever to downgrade packages and fix branches. Currently, nuget makes it quite hard to downgrade a package and set the allowed version for a package.

I usually install jquery with -version 1.10 , then go to the packages.config and add an allowedVersions="(,2)" and then do an update-package jquery just to be sure I'm using the latest version of 1.x branch.

This can be improved, and this is a proposal for 2 changes in how nuget installs packages:

1 - Update-Package should allow to downgrade versions easily, just by setting the version or with some option like "-downgrade".

With current installed version = 2.0.3, this should just downgrade it.

```
Update-Package jquery -version 1.10.2
```

This should not throw an error about newer version being installed. At most, it should just give a warning like "Downgrading the package from X to Y. Newer versions are available, use Update-package to upgrade again".

2 - Install-Package and Upgrade-Package should allow to set the "Allowed Versions" directly before install. Example:

```
Install-Package jquery -version (,2)
```

This should set the allowedVersions to the value, and proceed installing from there, selecting the latest version before 2.0.

The same way, having the current version = 2.0.3

```
Update-Package jquery -version (,2)
```

This should set the allowedVersion tag in packages.config, locate the higher version before 2.0 and downgrade automatically.

Nuget should only throw an error if other packages depends on higher version of this package, which would require you to first downgrade the other package using the same command or using -force or change the packages.config and -reinstall.
Comments: Very good suggestion.

Viewing all articles
Browse latest Browse all 7612

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>