Cake calls nuget install with the -ExcludeVersion switch. Because of this, NuGet doesn't know which version is currently installed, so if there's any version of the package currently installed, NuGet assumes that it's up to date, even though it's not.
For instance, if I have this in my tools/packages.config:
<package id="NUnit.ConsoleRunner" version="3.2.0" />
and the package is already installed, when I update the packages.config to this:
<package id="NUnit.ConsoleRunner" version="3.4.1" />
NuGet doesn't install the new version, because it assumes it's already there.
What is the proper way to force a packages to be update (besides removing the packages already in tools)? Was there a specific reason to use -ExcludeVersion?
Note that the same issue applies to Cake itself. If I just change the Cake version in packages.config and re-run build.ps1, I'm still using the version of Cake that was installed.
https://github.com/cake-build/cake/pull/925 This is how I've solved it when using packages.config file.
And no need to be scared of clearing the entire tools folder since NuGet normally caches all packages.
@mholo65 thanks, I like your solution :+1:. I hope it gets merged soon!
@thomaslevesque I am going to go ahead and close this issue, as I don't think there is anything else to be done here. If you feel different, please feel free to re-open.
@gep13 if #925 is merged, it should solve the problem for me :+1:
@thomaslevesque there is no guarantee that this PR will get merged. It is quite an opinionated thing to do, and as a result, might not be to everyone's taste. The bootstrapper that we do ship is intended simply as an example, but you can/should edit it to suit your own needs. There would be nothing to stop you taking the work that @mholo65 has done, and putting it into your own copy of the bootstrapper.
@thomaslevesque I have just merged @mholo65's suggestion into this repository, and I am away to make the same change in the default bootstrapper as well.
@gep13 great, thanks :smile:
Most helpful comment
@gep13 great, thanks :smile: