Get a list of all NuGet packages used in a solution

PackageReference as a package management format only works on a per project basis.
So you would need to “analyze” each project individually.

Update:

In .NET SDK versions, 2.2.100 and newer, dotnet list package.

Old version:

From the commandline, there “will” be a way to list all the packages.
It’s the “dotnet list package” command.
I say will, because it’s still in preview.
You can download the 2.2.100 version from here.
Related spec.

The simplest usage example is:

dotnet list YourSln.sln package

If you do not want to use a dotnet.exe preview, you can consider writing your own tool, by reading the assets files for each project, which is what the actual command does.
For reference, see code here and here

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)