3
Vote

How can I prevent nuget from reinstalling packages if no newer version was found?

description

Hi,

I'm using the nuget cmd tool in order to install the build tool "FAKE - F# Make" (https://github.com/fsharp/fake) via the following script:

"tools\nuget\nuget.exe" "install" "FAKE" "-OutputDirectory" "tools" "-ExcludeVersion"

Unfortunately nuget deinstalls and reinstalls FAKE every time I run the script even if no newer FAKE version was detected. How can I tell nuget to keep the current installation if no newer version was found?

Cheers,
Steffen

comments

forki wrote Jan 25 at 5:47 PM

BTW: I don't want to use the -Version flag since my build should always use the latest FAKE version.

dotnetjunky wrote Jan 31 at 10:17 PM

This is by design because you include the -ExcludeVersion parameter. When it is present, NuGet cannot determine what the current version you already have, so it just blindly uninstall and reinstall the package.

dotnetjunky wrote Jan 31 at 10:18 PM

by design

** Closed by dotnetjunky 01/31/2013 3:18PM

forki wrote Feb 1 at 7:13 AM

Actually nuget knows exactly which version it has installed:

From the output:

Successfully uninstalled 'FAKE 1.74.105.0'.
Successfully installed 'FAKE 1.74.105.0'.

dotnetjunky wrote Feb 5 at 5:10 PM

Will pull into 2.4 branch.