1

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.

But now when we look for any package that is not yet somewhere in the solution, we end up with a "No packages found":

Here we were looking for "roslynator" enter image description here

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: enter image description here

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. 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).

Seems to be an issue on Visual studio level, but I cannot understand what is causing it?

J4N
  • 19,480
  • 39
  • 187
  • 340
  • Does this answer your question? [VSTS package feed not pulling packages from upstream source (nuget.org)](https://stackoverflow.com/questions/48756017/vsts-package-feed-not-pulling-packages-from-upstream-source-nuget-org) – Tom Winter Dec 28 '22 at 21:23

2 Answers2

1

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. To install those packages:

  1. Copy the Install-Package command from the public registry (NuGet.org).
  2. Select Tools then NuGet Package Manager to open the NuGet package manager.
  3. Paste the command into the Package Manager Console and select run.

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: enter image description here

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. Enabling upstream sources also automatically enables saving of packages you use from the upstream source.

Walter
  • 2,640
  • 1
  • 5
  • 11
  • That seems stupid? Why the command would be able to install and search for it, but the userfriendly interface won't help the developer at all in doing all this? Looks more and more that Visual Studio is being deprecated... – J4N Apr 20 '21 at 04:44
  • @J4N Please see my update. When you add nuget.org as an upstream source, it means that packages can be installed from nuget.org, but you can only search for packages that are already in the feed. – Walter Apr 20 '21 at 05:31
  • But then, will it be referenced as coming from our azure pkg?(it's what happens when I add it through command line) – J4N Apr 22 '21 at 13:32
  • @J4N If you install packages with command in visual studio, the packages will also be added to your Azure Artifacts. After that you can search these packages in Azure DevOps package source. – Walter Apr 23 '21 at 06:37
  • @J4N May I know if you have any questions on this issue? If my reply helped or gave a right direction. Appreciate for marking it as an answer which will also help others in the community. – Walter Apr 27 '21 at 06:56
  • I've still not found how to have the same behavior than with the command line in the package manager. Using command line is a workaround, and having two sources of packages is a bit cumbersome(to have to switch between each source) – J4N Apr 27 '21 at 08:08
0

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

And I can confirm as of 12/28/2022 this is still an issue. :-(

Tom Winter
  • 1,813
  • 3
  • 18
  • 23