Cannot find package from NuGet stream hosted in Artifactory

守給你的承諾、 提交于 2020-01-14 08:16:21

问题


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?


回答1:


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.

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


来源:https://stackoverflow.com/questions/46249038/cannot-find-package-from-nuget-stream-hosted-in-artifactory

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!