Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure that the client version used when querying a repository is the version of the underlying NuGet.Client library #1935

Closed
mgiammarco opened this issue Oct 14, 2019 · 16 comments · Fixed by #2999
Labels
5 - Released Improvement Requires NuGet.Client Change This issue requires a modification to something in referenced NuGet.Client library.
Milestone

Comments

@mgiammarco
Copy link

I have a problem similar of the one in ticket 194.
I have received this message during installation of a software with choco install:

The 'Microsoft.NETCore.Platforms 3.0.0' package requires NuGet client version '2.12' or above, but the current NuGet version is '2.11.0.0'.

I have looked at ticket 194 but I need more help to solve it again.

So please tell me how to solve it.
Thanks,
Mario

@mgiammarco
Copy link
Author

choco install mycustompackage

The package has nested dependencies and then you get that error.
You can obtain the same error with:

choco install NETStandard.Library

Anyway the problem is correctly described in ticket 194: chocolatey presents itself as a nuget client with an old version number.

@ferventcoder
Copy link
Member

Is #194 closed?

@ferventcoder
Copy link
Member

Looks like it is. Please run your command again with -dv --log-file="'c:\choco_output.log'" and put that output here please.

@mgiammarco
Copy link
Author

mgiammarco commented Oct 15, 2019

2019-10-15 23:35:33,627 11980 [INFO ] - Chocolatey v0.10.15
2019-10-15 23:35:33,643 11980 [DEBUG] - Chocolatey is running on Windows v 10.0.18362.0
2019-10-15 23:35:33,643 11980 [DEBUG] - Attempting to delete file "C:/ProgramData/chocolatey/choco.exe.old".
2019-10-15 23:35:33,643 11980 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\choco.exe.old".
2019-10-15 23:35:33,674 11980 [DEBUG] - Command line: "C:\ProgramData\chocolatey\choco.exe" install NETStandard.Library -dv --log-file='c:\choco_output.log'
2019-10-15 23:35:33,674 11980 [DEBUG] - Received arguments: install NETStandard.Library -dv --log-file='c:\choco_output.log'
2019-10-15 23:35:33,737 11980 [DEBUG] - RemovePendingPackagesTask is now ready and waiting for PreRunMessage.
2019-10-15 23:35:33,752 11980 [DEBUG] - Sending message 'PreRunMessage' out if there are subscribers...
2019-10-15 23:35:33,768 11980 [DEBUG] - [Pending] Removing all pending packages that should not be considered installed...
2019-10-15 23:35:33,846 11980 [DEBUG] - Performing validation checks.
2019-10-15 23:35:33,861 11980 [DEBUG] - Global Configuration Validation Checks:
2019-10-15 23:35:33,861 11980 [DEBUG] -  - Package Exit Code / Exit On Reboot = Checked
2019-10-15 23:35:33,861 11980 [DEBUG] - System State Validation Checks:
2019-10-15 23:35:33,861 11980 [DEBUG] -  Reboot Requirement Checks:
2019-10-15 23:35:33,877 11980 [DEBUG] -  - Pending Computer Rename = Checked
2019-10-15 23:35:33,877 11980 [DEBUG] -  - Pending Component Based Servicing = Checked
2019-10-15 23:35:33,877 11980 [DEBUG] -  - Pending Windows Auto Update = Checked
2019-10-15 23:35:33,877 11980 [DEBUG] -  - Pending File Rename Operations = Ignored
2019-10-15 23:35:33,877 11980 [DEBUG] -  - Pending Windows Package Installer = Checked
2019-10-15 23:35:33,893 11980 [DEBUG] -  - Pending Windows Package Installer SysWow64 = Checked
2019-10-15 23:35:33,893 11980 [INFO ] - 2 validations performed. 2 success(es), 0 warning(s), and 0 error(s).
2019-10-15 23:35:33,893 11980 [DEBUG] - The source 'https://chocolatey.org/api/v2/;https://systemrepo.giammar.it/repository/nuget-group/' evaluated to a 'normal' source type
2019-10-15 23:35:33,893 11980 [DEBUG] -
NOTE: Hiding sensitive configuration data! Please double and triple
 check to be sure no sensitive data is shown, especially if copying
 output to a gist for review.
2019-10-15 23:35:33,924 11980 [DEBUG] - Configuration: CommandName='install'|
CacheLocation='C:\Users\Mario Giammarco\AppData\Local\Temp\chocolatey'|
ContainsLegacyPackageInstalls='True'|
CommandExecutionTimeoutSeconds='2700'|WebRequestTimeoutSeconds='30'|
Sources='https://chocolatey.org/api/v2/;https://systemrepo.giammar.it/repository/nuget-group/'|

SourceType='normal'|Debug='True'|Verbose='True'|Trace='False'|
Force='False'|Noop='False'|HelpRequested='False'|
UnsuccessfulParsing='False'|RegularOutput='True'|QuietOutput='False'|
PromptForConfirmation='True'|AcceptLicense='False'|
AllowUnofficialBuild='False'|
AdditionalLogFileLocation='c:\choco_output.log'|
Input='NETStandard.Library'|AllVersions='False'|
SkipPackageInstallProvider='False'|PackageNames='NETStandard.Library'|
Prerelease='False'|ForceX86='False'|OverrideArguments='False'|
NotSilent='False'|ApplyPackageParametersToDependencies='False'|
ApplyInstallArgumentsToDependencies='False'|IgnoreDependencies='False'|
AllowMultipleVersions='False'|AllowDowngrade='False'|
ForceDependencies='False'|Information.PlatformType='Windows'|
Information.PlatformVersion='10.0.18362.0'|
Information.PlatformName='Windows 10'|
Information.ChocolateyVersion='0.10.15.0'|
Information.ChocolateyProductVersion='0.10.15'|
Information.FullName='choco, Version=0.10.15.0, Culture=neutral, PublicKeyToken=79d02ea9cad655eb'|

Information.Is64BitOperatingSystem='True'|
Information.Is64BitProcess='True'|Information.IsInteractive='True'|
Information.UserName='Mario Giammarco'|
Information.UserDomainName='DESKTOP-1SMR5TO'|
Information.IsUserAdministrator='True'|
Information.IsUserSystemAccount='False'|
Information.IsUserRemoteDesktop='False'|
Information.IsUserRemote='True'|
Information.IsProcessElevated='True'|
Information.IsLicensedVersion='False'|Information.LicenseType='Foss'|
Information.CurrentDirectory='C:\WINDOWS\system32'|
Features.AutoUninstaller='True'|Features.ChecksumFiles='True'|
Features.AllowEmptyChecksums='False'|
Features.AllowEmptyChecksumsSecure='True'|
Features.FailOnAutoUninstaller='False'|
Features.FailOnStandardError='False'|Features.UsePowerShellHost='True'|
Features.LogEnvironmentValues='False'|Features.LogWithoutColor='False'|
Features.VirusCheck='False'|
Features.FailOnInvalidOrMissingLicense='False'|
Features.IgnoreInvalidOptionsSwitches='True'|
Features.UsePackageExitCodes='True'|
Features.UseEnhancedExitCodes='False'|
Features.UseFipsCompliantChecksums='False'|
Features.ShowNonElevatedWarnings='True'|
Features.ShowDownloadProgress='True'|
Features.StopOnFirstPackageFailure='False'|
Features.UseRememberedArgumentsForUpgrades='False'|
Features.IgnoreUnfoundPackagesOnUpgradeOutdated='False'|
Features.SkipPackageUpgradesWhenNotInstalled='False'|
Features.RemovePackageInformationOnUninstall='False'|
Features.ExitOnRebootDetected='False'|
Features.LogValidationResultsOnWarnings='True'|
Features.UsePackageRepositoryOptimizations='True'|
Features.ScriptsCheckLastExitCode='False'|
ListCommand.LocalOnly='False'|
ListCommand.IdOnly='False'|ListCommand.IncludeRegistryPrograms='False'|
ListCommand.PageSize='25'|ListCommand.Exact='False'|
ListCommand.ByIdOnly='False'|ListCommand.ByTagOnly='False'|
ListCommand.IdStartsWith='False'|ListCommand.OrderByPopularity='False'|
ListCommand.ApprovedOnly='False'|
ListCommand.DownloadCacheAvailable='False'|
ListCommand.NotBroken='False'|
ListCommand.IncludeVersionOverrides='False'|
UpgradeCommand.FailOnUnfound='False'|
UpgradeCommand.FailOnNotInstalled='False'|
UpgradeCommand.NotifyOnlyAvailableUpgrades='False'|
UpgradeCommand.ExcludePrerelease='False'|
NewCommand.AutomaticPackage='False'|
NewCommand.UseOriginalTemplate='False'|SourceCommand.Command='unknown'|
SourceCommand.Priority='0'|SourceCommand.BypassProxy='False'|
SourceCommand.AllowSelfService='False'|
SourceCommand.VisibleToAdminsOnly='False'|
FeatureCommand.Command='unknown'|ConfigCommand.Command='unknown'|
ApiKeyCommand.Remove='False'|PinCommand.Command='unknown'|
OutdatedCommand.IgnorePinned='False'|Proxy.BypassOnLocal='True'|
2019-10-15 23:35:33,955 11980 [DEBUG] - _ Chocolatey:ChocolateyInstallCommand - Normal Run Mode _
2019-10-15 23:35:33,971 11980 [INFO ] - Installing the following packages:
2019-10-15 23:35:33,971 11980 [INFO ] - NETStandard.Library
2019-10-15 23:35:33,986 11980 [INFO ] - By installing you accept licenses for the packages.
2019-10-15 23:35:34,127 11980 [DEBUG] - Using 'https://chocolatey.org/api/v2/'.
2019-10-15 23:35:34,783 11980 [DEBUG] - - Supports prereleases? 'True'.
2019-10-15 23:35:34,799 11980 [DEBUG] - - Is ServiceBased? 'True'.
2019-10-15 23:35:35,627 11980 [DEBUG] - Using 'https://systemrepo.giammar.it/repository/nuget-group/'.
2019-10-15 23:35:36,080 11980 [DEBUG] - - Supports prereleases? 'True'.
2019-10-15 23:35:36,096 11980 [DEBUG] - - Is ServiceBased? 'True'.
2019-10-15 23:35:37,235 11980 [DEBUG] - Package 'netstandard.library' found on source 'https://systemrepo.giammar.it/repository/nuget-group/'
2019-10-15 23:35:37,341 11980 [INFO ] - [NuGet] Attempting to resolve dependency 'Microsoft.NETCore.Platforms (= 1.1.0)'.
2019-10-15 23:35:37,565 11980 [ERROR] - NETStandard.Library not installed. An error occurred during installation:
 The 'Microsoft.NETCore.Platforms 3.0.0' package requires NuGet client version '2.12' or above, but the current NuGet version is '2.11.0.0'.
2019-10-15 23:35:37,582 11980 [INFO ] - NETStandard.Library package files install completed. Performing other installation steps.
2019-10-15 23:35:37,588 11980 [DEBUG] - No package information as package is null.
2019-10-15 23:35:37,615 11980 [DEBUG] - No package information to save as package is null.
2019-10-15 23:35:37,623 11980 [DEBUG] - Sending message 'HandlePackageResultCompletedMessage' out if there are subscribers...
2019-10-15 23:35:37,629 11980 [ERROR] - The install of NETStandard.Library was NOT successful.
2019-10-15 23:35:37,636 11980 [ERROR] - NETStandard.Library not installed. An error occurred during installation:
 The 'Microsoft.NETCore.Platforms 3.0.0' package requires NuGet client version '2.12' or above, but the current NuGet version is '2.11.0.0'.
2019-10-15 23:35:37,660 11980 [WARN ] -
Chocolatey installed 0/1 packages. 1 packages failed.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
2019-10-15 23:35:37,668 11980 [INFO ] -
2019-10-15 23:35:37,672 11980 [ERROR] - Failures
2019-10-15 23:35:37,676 11980 [ERROR] -  - NETStandard.Library (exited 1) - NETStandard.Library not installed. An error occurred during installation:
 The 'Microsoft.NETCore.Platforms 3.0.0' package requires NuGet client version '2.12' or above, but the current NuGet version is '2.11.0.0'.
2019-10-15 23:35:37,682 11980 [WARN ] -
Did you know the proceeds of Pro (and some proceeds from other
 licensed editions) go into bettering the community infrastructure?
 Your support ensures an active community, keeps Chocolatey tip top,
 plus it nets you some awesome features!
 https://chocolatey.org/compare
2019-10-15 23:35:37,695 11980 [DEBUG] - Sending message 'PostRunMessage' out if there are subscribers...
2019-10-15 23:35:37,770 11980 [DEBUG] - Exiting with 1

@ferventcoder
Copy link
Member

Quick question here - you are using Chocolatey to install something from NuGet - which may just be DLLs. I'm assuming this is on purpose?

@mgiammarco
Copy link
Author

Yes it is on purpose. Basically the main chocolatey package a several nested dependencies and one of them wants a nuget package.

@mgiammarco
Copy link
Author

So basically what can I do? Is there a workaround?

@wirthandras
Copy link

Same problem for me too.

PS C:\Windows\system32> choco install NETStandard.Library --version 2.0.3 --source https://dotnet.myget.org/F/dotnet-core/api/v2
Chocolatey v0.10.15
Installing the following packages:
NETStandard.Library
By installing you accept licenses for the packages.
NETStandard.Library not installed. An error occurred during installation:
 The 'NETStandard.Library 2.0.3' package requires NuGet client version '2.12' or above, but the current NuGet version is '2.11.0.0'.
NETStandard.Library package files install completed. Performing other installation steps.
The install of NETStandard.Library was NOT successful.
NETStandard.Library not installed. An error occurred during installation:
 The 'NETStandard.Library 2.0.3' package requires NuGet client version '2.12' or above, but the current NuGet version is '2.11.0.0'.

Chocolatey installed 0/1 packages. 1 packages failed.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

Failures
 - NETStandard.Library (exited 1) - NETStandard.Library not installed. An error occurred during installation:
 The 'NETStandard.Library 2.0.3' package requires NuGet client version '2.12' or above, but the current NuGet version is '2.11.0.0'.
PS C:\Windows\system32> nuget update -self
Checking for updates from https://www.nuget.org/api/v2/.
Currently running NuGet.exe 5.4.0.
NuGet.exe is up to date.

Ran into following by:
https://dotnet.myget.org/feed/dotnet-core/package/nuget/NETStandard.Library/2.0.3#

My nuget exe installed from chocolatey

I didn't understand what is NuGet client version '2.12' when i have version 5.4.0

What I doing wrong?

@mgiammarco
Copy link
Author

The problem is there it has not gone away, how can I solve it?
Any news?

@RadmirT
Copy link

RadmirT commented Jan 20, 2022

I have same poroblem.

The install of sqlrunner was NOT successful.
sqlrunner not installed. An error occurred during installation:
The 'System.Reflection.Emit.Lightweight 4.3.0' package requires NuGet client version '2.12' or above, but the current NuGet version is '2.11.0.0'.

Do you have any ideas?

@pauby pauby changed the title Same problem as ticket 194 (nuget specific version required) When specific nuget version is needed by a package it is the chocolatey version that is used Jan 20, 2022
@pauby
Copy link
Member

pauby commented Jan 20, 2022

As a workaround, does using nuget.exe to install the NuGet packages work?

@RadmirT
Copy link

RadmirT commented Jan 21, 2022

Yes, nuget.exe works fine.

@gep13
Copy link
Member

gep13 commented Jan 21, 2022

@RadmirT as mentioned in the related issue, the reason that this happens is due to the fact that we are embedding a specific version of NuGet.Core into Chocolatey, and it is its version number that is presented when talking to nuget.org. The package that you are trying to install must use "something" (perhaps in the metadata that it uses) that requires a newer client version in order to understand/interpret it.

As a result, there is nothing that we can currently do to workaround this. At some point in the future, we will be updating the NuGet.Core library that we are using within Chocolatey, but that isn't going to happen soon.

As such, the recommendation would be to use nuget.exe for placing this package where it is required.

@TheCakeIsNaOH TheCakeIsNaOH added the Requires NuGet.Client Change This issue requires a modification to something in referenced NuGet.Client library. label Feb 4, 2022
@gep13 gep13 added this to the 2.0.0 milestone Nov 21, 2022
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Jan 26, 2023
These added tests ensure that a minClientVersion attribute that is higher
than the Chocolatey and NuGet assembly versions does not prevent installation
or packing.
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Jan 26, 2023
This both ensures that the user agent is set, when NuGet sources are configured
and that it uses the upstream version of NuGet that the NuGet assembles are
based on. This same version is used in other areas as well, like minClientVersion,
so it applies to multiple areas.
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Jan 26, 2023
These added tests ensure that a minClientVersion attribute that is higher
than the Chocolatey and NuGet assembly versions does not prevent installation
or packing.
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Jan 26, 2023
This both ensures that the user agent is set, when NuGet sources are configured
and that it uses the upstream version of NuGet that the NuGet assembles are
based on. This same version is used in other areas as well, like minClientVersion,
so it applies to multiple areas.
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Jan 27, 2023
These added tests ensure that a minClientVersion attribute that is higher
than the Chocolatey and NuGet assembly versions does not prevent installation
or packing.
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Jan 27, 2023
This both ensures that the user agent is set, when NuGet sources are configured
and that it uses the upstream version of NuGet that the NuGet assembles are
based on. This same version is used in other areas as well, like minClientVersion,
so it applies to multiple areas.
@pauby
Copy link
Member

pauby commented Mar 16, 2023

This works with in the latest alpha version 2.0.0-alpha-20230307.

> choco install NETStandard.Library --source='https://nuget.org/api/v2' --disable-repository-optimizations
Chocolatey v2.0.0-alpha-20230307
Installing the following packages:
NETStandard.Library
By installing, you accept licenses for the packages.
Progress: Downloading Microsoft.NETCore.Platforms 7.0.1... 100%

Microsoft.NETCore.Platforms v7.0.1
Microsoft.NETCore.Platforms package files install completed. Performing other installation steps.
 The install of Microsoft.NETCore.Platforms was successful.
  Software installed to 'C:\ProgramData\chocolatey\lib\Microsoft.NETCore.Platforms'
Progress: Downloading NETStandard.Library 2.0.3... 100%

NETStandard.Library v2.0.3
NETStandard.Library package files install completed. Performing other installation steps.
 The install of NETStandard.Library was successful.
  Software installed to 'C:\ProgramData\chocolatey\lib\NETStandard.Library'

Chocolatey installed 2/2 packages.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

Warnings:
 - Microsoft.NETCore.Platforms - Issues found with nuspec elements
CHCU0002: <icon> elements are not supported in Chocolatey CLI, use <iconUrl> instead.
CHCU0002: <license> elements are not supported in Chocolatey CLI, use <licenseUrl> instead.
CHCU0002: <repository> elements are not supported in Chocolatey CLI, use <packageSourceUrl> instead.
CHCU0002: <serviceable> elements are not supported in Chocolatey CLI.
 - NETStandard.Library - Issues found with nuspec elements
CHCU0002: <serviceable> elements are not supported in Chocolatey CLI.

TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Mar 16, 2023
These added tests ensure that a minClientVersion attribute that is higher
than the Chocolatey and NuGet assembly versions does not prevent installation
or packing.
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Mar 16, 2023
This both ensures that the user agent is set, when NuGet sources are configured
and that it uses the upstream version of NuGet that the NuGet assembles are
based on. This same version is used in other areas as well, like minClientVersion,
so it applies to multiple areas.
@TheCakeIsNaOH
Copy link
Member

That agrees with my testing. See #2999 which is a PR that adds tests for this.

TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Apr 6, 2023
These added tests ensure that a minClientVersion attribute that is higher
than the Chocolatey and NuGet assembly versions does not prevent installation
or packing.
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Apr 6, 2023
This both ensures that the user agent is set, when NuGet sources are configured
and that it uses the upstream version of NuGet that the NuGet assembles are
based on. This same version is used in other areas as well, like minClientVersion,
so it applies to multiple areas.
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Apr 6, 2023
This both ensures that the user agent is set, when NuGet sources are configured
and that it uses the upstream version of NuGet that the NuGet assembles are
based on. This same version is used in other areas as well, like minClientVersion,
so it applies to multiple areas.
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Apr 7, 2023
This both ensures that the user agent is set, when NuGet sources are configured
and that it uses the upstream version of NuGet that the NuGet assembles are
based on. This same version is used in other areas as well, like minClientVersion,
so it applies to multiple areas.
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Apr 7, 2023
This both ensures that the user agent is set, when NuGet sources are configured
and that it uses the upstream version of NuGet that the NuGet assembles are
based on. This same version is used in other areas as well, like minClientVersion,
so it applies to multiple areas.
gep13 pushed a commit to TheCakeIsNaOH/choco that referenced this issue Apr 17, 2023
These added tests ensure that a minClientVersion attribute that is higher
than the Chocolatey and NuGet assembly versions does not prevent installation
or packing.
gep13 pushed a commit to TheCakeIsNaOH/choco that referenced this issue Apr 17, 2023
This both ensures that the user agent is set, when NuGet sources are configured
and that it uses the upstream version of NuGet that the NuGet assembles are
based on. This same version is used in other areas as well, like minClientVersion,
so it applies to multiple areas.
gep13 pushed a commit to TheCakeIsNaOH/choco that referenced this issue Apr 17, 2023
This both ensures that the user agent is set, when NuGet sources are configured
and that it uses the upstream version of NuGet that the NuGet assembles are
based on. This same version is used in other areas as well, like minClientVersion,
so it applies to multiple areas.
gep13 added a commit that referenced this issue Apr 17, 2023
(#1935) Add tests to ensure upstream NuGet version is used.
@gep13 gep13 added 4 - Done and removed 3 - Review labels Apr 17, 2023
@gep13 gep13 closed this as completed Apr 17, 2023
@gep13 gep13 changed the title When specific nuget version is needed by a package it is the chocolatey version that is used Ensure that the client version used when querying a repository is the version of the underlying NuGet.Client library Apr 25, 2023
corbob pushed a commit to corbob/choco that referenced this issue Apr 25, 2023
…ests

(chocolatey#1935) Add tests to ensure upstream NuGet version is used.
@choco-bot
Copy link

🎉 This issue has been resolved in version 2.0.0 🎉

The release is available on:

Your GitReleaseManager bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5 - Released Improvement Requires NuGet.Client Change This issue requires a modification to something in referenced NuGet.Client library.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants