Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot find package from NuGet stream hosted in Artifactory

So we have an Artifactory set up to share different resources for our team and one of them ofcourse being NuGet packages. Now, I am very very new to Artifactory and one of my teammate uploaded a NuGet package on Artifactory and gave the stream address which looks like :

Http:/OurArtifactory/api/nuget/folder

I went ahead and added that URL as a new NuGet source on my visual studio. And Visual studio added that address as a valid source. So far so good. Now, when I go to the browse window of NuGet Package manager in my VS, I was expecting to see that one package which I see hosted in Artifactory. But I do not see any package when I am on that window.

Now, since this is an authenticated server, I realized that I have to set my security credentials here. Which I did using following commands:

nuget setapikey [apikey] -source [feedUrl] nuget sources add|update -Name [name] -source [feedUrl] -User [username] -pass [password]

Also here I tried supplying

  • Regular password, encrypted password and also API KEy in the password field of the command but nothing seems to be working.

Now, even after I set the security credentials, the problem remains. One more thing I realized when I requested verbose logs with creating -verbose flag on is that it is definitely able to find the stream and getting OK back from the stream, its just when it tries to find the package, then it does not find the package inside the stream. My logs looks like below:

install-package ArrayAnalysis.Data -verbose GET https://url/finbyId()' OK https://url/findbyid()' 5ms Install-Package : Unable to find package 'package.name' At line:1 char:16 + install-package <<<< ArrayAnalysis.Data -verbose + CategoryInfo : NotSpecified: (:) [Install-Package], Exception + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand

I am not sure if I am supposed to be doing something that I am missing. Any ideas?

like image 771
Lost Avatar asked Sep 16 '17 00:09

Lost


1 Answers

Please make sure that "Include prerelease" option is checked when you want to show a prelease version or you nuget feed only have prerelease packages. enter image description here

And if you want to install the prelease version via command in Nuget Package Manager Console, you have to specify the detailed version. For example:

install-package ClassLib -version 1.0.0-rtm
like image 116
Eddie Chen - MSFT Avatar answered Nov 02 '22 12:11

Eddie Chen - MSFT