[英]Nuget package in Artifactory does not show up in available packages in Visual Studio
I am trying to use an Artifactory repository as a nuget package source in Visual Studio 2017, and my nuget package does not show up in the Nuget Package Manager.我正在尝试使用 Artifactory 存储库作为 Visual Studio 2017 中的 nuget 包源,但我的 nuget 包没有显示在 Nuget 包管理器中。 The manager says "No packages found" (or only shows existing installed packages).
经理说“找不到包”(或只显示现有的已安装包)。 In PackageManager Settings / Package Sources, I set up a package source with a url like the one below
在 PackageManager Settings / Package Sources 中,我设置了一个包源,其 URL 如下所示
http://server_name/artifactory/api/nuget/repository_name http://server_name/artifactory/api/nuget/repository_name
In Manage Packages for Solution, I only selected this one source and clicked "Include prerelease", but no sign of my package in the package manager.在 Manage Packages for Solution 中,我只选择了这一个源并单击了“Include prerelease”,但在包管理器中没有我的包的迹象。 I can successfully upload and download nuget packages to/from the repository using jfrog.exe without a problem.
我可以使用 jfrog.exe 成功地将 nuget 包上传到/从存储库下载,没有问题。 If I enter my repository url in a web browser, it shows the repository service as an xml page.
如果我在 Web 浏览器中输入我的存储库 URL,它会将存储库服务显示为一个 xml 页面。
Any idea what could be preventing the available nuget packages from being shown in the package manager?知道什么会阻止可用的 nuget 包显示在包管理器中吗?
Any idea what could be preventing the available nuget packages from being shown in the package manager?
知道什么会阻止可用的 nuget 包显示在包管理器中吗?
Artifactory repository is an authenticated server, you should set your security credentials by using following commands before use it in the package manager: Artifactory 存储库是一个经过身份验证的服务器,在包管理器中使用它之前,您应该使用以下命令设置您的安全凭据:
nuget setapikey [apikey] -source [feedUrl]
nuget sources add|update -Name [name] -source [feedUrl] -User [username] -pass [password]
Make sure you can use nuget.exe to push the nuget package to the server successfully.确保您可以使用 nuget.exe 成功将 nuget 包推送到服务器。
Here is a video about how to set up Artifactory as a NuGet repository , you can refer it for some more details.这是一个关于如何将 Artifactory 设置为 NuGet 存储库的视频,您可以参考它了解更多详细信息。
I found that what finally fixed the problem for me was to login as admin, select my repository under local repositories, and check the Force Authentication checkbox.我发现最终为我解决问题的是以管理员身份登录,在本地存储库下选择我的存储库,然后选中强制身份验证复选框。 That makes Nuget pop up a username/password dialog, and after I fill it in, I can see my nugget package and install it ok.
这让Nuget弹出一个用户名/密码对话框,填完之后就可以看到我的nugget包并安装好了。
See an open bug on the JFrog site.在 JFrog 站点上查看一个未解决的错误。 Local Nuget Repositories cannot be searched by tags or other metadata within visual studio 2015/2017
无法在 Visual Studio 2015/2017 中通过标签或其他元数据搜索本地 Nuget 存储库
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.