0

In Visual Studio how do I find with 'Package Manager Console' or some other tool the source repository where specific package is available from?

find-package NLog

will only find package from one of the repository sources and display its version, but I don't know from which one is it coming from.

user007
  • 1,122
  • 1
  • 10
  • 30
  • Is there a problem you're trying to solve? If so, what is it? VS/PMC will use the list of sources/feeds in .nuget\NuGet.config (usually under each solution) when it restores/updates, etc. packages. So, for starters, it's going to be from one of those sources – Gregg L Mar 22 '18 at 18:49
  • Also, see [this SO question](https://stackoverflow.com/questions/44787914/is-there-a-way-to-view-which-package-source-an-installed-nuget-package-is-from); seems to be similar – Gregg L Mar 22 '18 at 18:55
  • @GreggL, yes, this question is very similar, but not exactly the same. That one is view which package source an installed NuGet package is from, means to obtain the package source of the package based on the downloaded package. – Leo Liu Mar 23 '18 at 03:51

1 Answers1

1

Find Nuget package source repository

According to the Find-Package:

Gets the set of remote packages with specified ID or keywords from the package source.

So, the default behavior of this command line is that search all package source, then only return Package ID, Versions, Description without package source of the highest version package.

Return result looks like:

Id                                  Versions                                 Description                                                                                                                                 
--                                  --------                                 -----------                                                                                                                                 
Newtonsoft.Json                     {11.0.1}                                 Json.NET is a popular high-performance JSON framework for .NET                                                                              
Time Elapsed: 00:00:00.0206440

Fortunately, there is a parameters Source of the syntax Find-Package, you can find the nuget package from the specified source, like:

find-package Newtonsoft.Json -source nuget.org

Or you just repeat the same command line find-package NLog with different package source selected in the Package Manager Console:

enter image description here

Hope this helps.

Leo Liu
  • 71,098
  • 10
  • 114
  • 135