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

Cannot find the package Microsoft.Azure.IoTHub.IoTHubClient #504

Closed
turbolego opened this issue May 29, 2018 · 1 comment
Closed

Cannot find the package Microsoft.Azure.IoTHub.IoTHubClient #504

turbolego opened this issue May 29, 2018 · 1 comment

Comments

@turbolego
Copy link

turbolego commented May 29, 2018

EDIT: Fix here: OneGet/oneget#360

PS C:\WINDOWS\system32> Update-Module -Name PowerShellGet
PS C:\WINDOWS\system32> Install-Module PackageManagement -Force -Repository PSGallery -AllowPrerelease
PS C:\WINDOWS\system32> Install-Package Microsoft.Azure.IoTHub.IoTHubClient
  • OS and version used: Windows 10

  • SDK version used: N/A

Description of the issue:

Code sample exhibiting the issue:

I'm trying to run:

Install-Package Microsoft.Azure.IoTHub.IoTHubClient

From https://github.com/Azure/azure-iot-sdk-c/tree/master/iothub_client

Console log of the issue:

But i get this error:

Install-Package : No match was found for the specified search criteria and package name 'Microsoft.Azure.IoTHub.IoTHubClient'. Try Get-PackageSource to see al
l available registered package sources.
At line:1 char:1
+ Install-Package Microsoft.Azure.IoTHub.IoTHubClient
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Microsoft.Power....InstallPackage:InstallPackage) [Install-Package], Exception
    + FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage

Result of Get-PackageSource

Name                             ProviderName     IsTrusted  Location
----                             ------------     ---------  --------
PSGallery                        PowerShellGet    False      https://www.powershellgallery.com/api/v2/

Perhaps there is a package source i need to add?

Thanks!

@turbolego
Copy link
Author

This is what fixed this issue for me:

Register-PackageSource -Name nuget.org -Location https://www.nuget.org/api/v2 -ProviderName NuGet

Log:

PS C:\WINDOWS\system32> Register-PackageSource -Name nuget.org -Location https://www.nuget.org/api/v2 -ProviderName NuGet

Name                             ProviderName     IsTrusted  Location
----                             ------------     ---------  --------
nuget.org                        NuGet            False      https://www.nuget.org/api/v2

PS C:\WINDOWS\system32> Install-Package Microsoft.Azure.IoTHub.IoTHubClient -Verbose
VERBOSE: Using the provider 'NuGet' for searching packages.
VERBOSE: Using the provider 'msi' for searching packages.
VERBOSE: Using the provider 'Programs' for searching packages.
VERBOSE: Using the provider 'msu' for searching packages.
VERBOSE: Using the provider 'PowerShellGet' for searching packages.
VERBOSE: The -Repository parameter was not specified.  PowerShellGet will use all of the registered repositories.
VERBOSE: Getting the provider object for the PackageManagement Provider 'NuGet'.
VERBOSE: The specified Location is 'https://www.powershellgallery.com/api/v2/' and PackageManagementProvider is 'NuGet'.
VERBOSE: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='Microsoft.Azure.IoTHub.IoTHubClient'' for ''.
VERBOSE: Searching repository 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='Microsoft.Azure.IoTHub.IoTHubClient'' for ''.
VERBOSE: Total package yield:'0' for the specified package 'Microsoft.Azure.IoTHub.IoTHubClient'.
VERBOSE: Total package yield:'1' for the specified package 'Microsoft.Azure.IoTHub.IoTHubClient'.
VERBOSE: Performing the operation "Install Package" on target "Package 'Microsoft.Azure.IoTHub.IoTHubClient' version '1.2.4' from 'nuget.org'.".

The package(s) come(s) from a package source that is not marked as trusted.
Are you sure you want to install software from 'nuget.org'?
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "N"): A
VERBOSE: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='Microsoft.Azure.IoTHub.IoTHubClient'' for ''.
VERBOSE: Searching repository 'https://www.nuget.org/api/v2/FindPackagesById()?id='Microsoft.Azure.C.SharedUtility'' for ''.
VERBOSE: InstallPackage' - name='Microsoft.Azure.C.SharedUtility', version='1.1.4',destination='C:\Program Files\PackageManagement\NuGet\Packages'
VERBOSE: DownloadPackage' - name='Microsoft.Azure.C.SharedUtility', version='1.1.4',destination='C:\Program Files\PackageManagement\NuGet\Packages\Microsoft.Azure.C.SharedUtility.1.1.4\Microsoft.Azure.C.SharedUtility.1.1.4.nupkg',
uri='https://www.nuget.org/api/v2/package/Microsoft.Azure.C.SharedUtility/1.1.4'
VERBOSE: Downloading 'https://www.nuget.org/api/v2/package/Microsoft.Azure.C.SharedUtility/1.1.4'.
VERBOSE: Completed downloading 'https://www.nuget.org/api/v2/package/Microsoft.Azure.C.SharedUtility/1.1.4'.
VERBOSE: Completed downloading 'Microsoft.Azure.C.SharedUtility'.
VERBOSE: Hash for package 'Microsoft.Azure.C.SharedUtility' does not match hash provided from the server.
VERBOSE: InstallPackageLocal' - name='Microsoft.Azure.C.SharedUtility', version='1.1.4',destination='C:\Program Files\PackageManagement\NuGet\Packages'
VERBOSE: InstallPackage' - name='Microsoft.Azure.IoTHub.IoTHubClient', version='1.2.4',destination='C:\Program Files\PackageManagement\NuGet\Packages'
VERBOSE: DownloadPackage' - name='Microsoft.Azure.IoTHub.IoTHubClient', version='1.2.4',destination='C:\Program
Files\PackageManagement\NuGet\Packages\Microsoft.Azure.IoTHub.IoTHubClient.1.2.4\Microsoft.Azure.IoTHub.IoTHubClient.1.2.4.nupkg', uri='https://www.nuget.org/api/v2/package/Microsoft.Azure.IoTHub.IoTHubClient/1.2.4'
VERBOSE: Downloading 'https://www.nuget.org/api/v2/package/Microsoft.Azure.IoTHub.IoTHubClient/1.2.4'.
VERBOSE: Completed downloading 'https://www.nuget.org/api/v2/package/Microsoft.Azure.IoTHub.IoTHubClient/1.2.4'.
VERBOSE: Completed downloading 'Microsoft.Azure.IoTHub.IoTHubClient'.
VERBOSE: Hash for package 'Microsoft.Azure.IoTHub.IoTHubClient' does not match hash provided from the server.
VERBOSE: InstallPackageLocal' - name='Microsoft.Azure.IoTHub.IoTHubClient', version='1.2.4',destination='C:\Program Files\PackageManagement\NuGet\Packages'

Name                           Version          Source           Summary
----                           -------          ------           -------
Microsoft.Azure.C.SharedUti... 1.1.4            nuget.org        This nuget package can be used to develop applications and libraries
Microsoft.Azure.IoTHub.IoTH... 1.2.4            nuget.org        This nuget package contains common interface shared between AMQP, MQTT and HTTP transports to IoTHub

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant