简体   繁体   English

当将 Azure 工件作为 package 源时,“找不到包”

[英]"No packages found" when having Azure Artifact as package source

Due to the usage of Babel, that require us to host ourself the package manager on a private repository, we are using Azure Devop as a source of our packages.由于 Babel 的使用,这要求我们在私有存储库上托管 package 管理器,我们使用 Azure Devop 作为我们包的来源。

But now when we look for any package that is not yet somewhere in the solution, we end up with a "No packages found":但是现在当我们寻找解决方案中尚未找到的任何 package 时,我们最终会得到“找不到包”:

Here we were looking for "roslynator"我们在这里寻找“roslynator” 在此处输入图像描述

If I do this same request in a brand new project.如果我在一个全新的项目中做同样的请求。 No issues at all, I find the packages.完全没有问题,我找到了包裹。

but we have nuget.org correctly specified in the upstream sources:但是我们在上游资源中正确指定了 nuget.org: 在此处输入图像描述

And the whole team is listed as contributor.整个团队都被列为贡献者。 I cannot find any error anywhere when we are fetching the packages.当我们获取包裹时,我在任何地方都找不到任何错误。 I tried to execute the command Install-package Roslynator .我试图执行命令Install-package Roslynator The commands succeed, and then I'm able to see the package in the GUI of visual studio(and in the web console of visual studio).命令成功,然后我可以在 visual studio 的 GUI 中看到 package(在 visual studio 的 web 控制台中)。

Seems to be an issue on Visual studio level, but I cannot understand what is causing it?似乎是 Visual Studio 级别的问题,但我不明白是什么原因造成的?

According to the steps in the Consume NuGet packages in Visual Studio document: If you're using upstream sources, any packages from upstream sources that haven't been saved to your feed yet (by using them at least once) won't appear in the Package Manager search result.根据在 Visual Studio 文档中使用 NuGet 包中的步骤:如果您使用上游源,来自上游源的任何尚未保存到您的提要的包(至少使用一次)都不会出现在Package 经理搜索结果。 To install those packages:要安装这些软件包:

  1. Copy the Install-Package command from the public registry (NuGet.org).从公共注册表 (NuGet.org) 复制 Install-Package 命令。
  2. Select Tools then NuGet Package Manager to open the NuGet package manager. Select Tools then NuGet Package Manager to open the NuGet package manager.
  3. Paste the command into the Package Manager Console and select run.将命令粘贴到 Package 管理器控制台和 select 运行中。

So this is the expected behavior and your steps are correct.所以这是预期的行为,您的步骤是正确的。

Update:更新:

If you want to find all packages in nuget.org, you need to choose nuget.org as source and search packages instead of using your Azure DevOps sources:如果要查找 nuget.org 中的所有包,则需要选择 nuget.org 作为源并搜索包,而不是使用 Azure DevOps 源: 在此处输入图像描述

According to this document :The nuget.org upstream source allows you to merge the contents of nuget.org into your feed such that the NuGet client can install packages from both locations without making multiple search queries.根据此文档:nuget.org 上游源允许您将 nuget.org 的内容合并到您的提要中,这样 NuGet 客户端可以从两个位置安装包,而无需进行多个搜索查询。 Enabling upstream sources also automatically enables saving of packages you use from the upstream source.启用上游源还可以自动保存您从上游源使用的包。

If you dislike this behavior (and who wouldn't) you can up-vote this Visual Studio Developer Community issue: Allow search upstream sources on Azure Artifacts如果您不喜欢这种行为(谁不喜欢),您可以对这个 Visual Studio 开发人员社区问题投赞成票: 允许在 Azure 工件上搜索上游源

And I can confirm as of 12/28/2022 this is still an issue.我可以确认截至 2022 年 12 月 28 日这仍然是一个问题。 :-( :-(

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM