_From @NickDarvey on December 18, 2017 4:43_
vswhereFinds package vswhere.
WARNING: Could not get response from query
'https://api.nuget.org/v3/index.json/FindPackagesById()?id='vswhere'&$skip=0&$top=40'.
> Install-PackageProvider -Name NuGet -Force -Scope CurrentUser
> Get-PackageSource
Name ProviderName IsTrusted Location
---- ------------ --------- --------
chocolatey Chocolatey False http://chocolatey.org/api/v2/
nuget.org NuGet False https://api.nuget.org/v3/index.json
PSGallery PowerShellGet False https://www.powershellgallery.com/api/v2/
> Find-Package vswhere
Name Version Source Summary
---- ------- ------ -------
vswhere 2.2.11 chocolatey Locate Visual Studio 2017 and newer installations
WARNING: Could not get response from query
'https://api.nuget.org/v3/index.json/FindPackagesById()?id='vswhere'&$skip=0&$top=40'.
_Copied from original issue: NuGet/NuGetGallery#5197_
@NickDarvey Are you facing the same error consistently?
I am not seeing that error. It may have been an intermittent connectivity issue on nuget gallery.
It seems that the url showing up is incorrect for V3 protocol. We need to investigate this more to understand if the Find-Package command needs updating.
@jainaashish did some investigation and this problem exists since atleast 15.4. Keeping at P1.
Do we have a ETA for a fix on this?
@RedsGT what version of Visual Studio are you using?
@emgarten
This isn't VS PowerShell. This is full blown PS v5 PowerShell. You can repro in two lines of PS on any Win10 machine (or any win box with PS v5 on it):
Install-PackageProvider -Name NuGet -Scope CurrentUser -Force
Install-Package -Name Microsoft.CrmSdk.CoreAssemblies -ProviderName nuget -Force
This package clearly exists: https://www.nuget.org/packages/Microsoft.CrmSdk.CoreAssemblies/
A Fiddler trace shows the API URL hit as:
https://api.nuget.org/v3/index.json/FindPackagesById()?id='Microsoft.CrmSdk.CoreAssemblies'&$skip=0&$top=40
with no HTML body in the request.
The result is the same JSON you see if you hit https://api.nuget.org/v3/index.json . You can try both in a browser to see that it's not returning results.
You can workaround the issue by using: https://www.nuget.org/api/v2/
As far as I know PS v5 PowerShell does not support nuget v3 feeds.
NuGet libraries contain support for v3 and powershell can upgrade to using the 3.x or 4.x libraries to enable that support. Currently they are using 2.x.
@emgarten
Thanks for the heads up.
If anyone is reading this later, this worked for me:
Install-Package -Name Microsoft.CrmSdk.CoreAssemblies -ProviderName nuget -Source "https://www.nuget.org/api/v2/" -Scope CurrentUser -Force
@emgarten, isn't this still an issue though? When you call
Install-PackageProvider -Name NuGet -Force -Scope CurrentUser
it installs the provider using the v3 URL.
If it doesn't support it, it should install the provider using the v2 URL. (Though, I'm not sure whose responsibility this is.)
There is really a lack of info on this issue when looking around for it.
find-package to that URI.N.B. I even updated to the latest version of PowerShellGet (v2).
Would be wonderful to know what is it up and down on this. Thank you.
Hello there, first of all, thanks for the hints, solved my problem as well.
Working on Windows 10 1803, with PowerShell 5.1 and
NuGet: 2.8.5.208
I had to change the feed from V3
……../alvepsgallery/nuget/v3/index.json"
To V2
………../alvepsgallery/nuget/v2/"
Then reregistered the repository using Register-PSRepository
and then all worked as expected, i.e. I can now search the feed for modules.
Find-Module -Name MyModule -Repository "MyPrivateFeed" -Credential $credential
Thanks
Most helpful comment
You can workaround the issue by using:
https://www.nuget.org/api/v2/As far as I know PS v5 PowerShell does not support nuget v3 feeds.
NuGet libraries contain support for v3 and powershell can upgrade to using the 3.x or 4.x libraries to enable that support. Currently they are using 2.x.