How do I list all installed NuGet packages?

asp.netVisual StudioNugetCommand Line-Interface

asp.net Problem Overview


How does one list all locally installed NuGet packages?

Is there a NuGet equivalent of RPM -qa? Within Chocolatey there is the chocolatey list -localonly, but for the life of me I cannot find the NuGet equivalent of that command.

asp.net Solutions


Solution 1 - asp.net

In the NuGet Package Manager Console, enter the following command:

Get-Package | Format-Table -AutoSize

This will either print out a list of installed packages, or if none are present write the following line to the console:

PM> Get-Package
No packages installed.

For more details, have a look at the NuGet PowerShell Reference.

Solution 2 - asp.net

If you just do

Get-Package

it will list the packages and where they are referenced. It will list the same packages over and over again if you have them referenced many times. If you want to get a clean list of all packages installed in the solution you can do

Get-Package | select -Unique Id, Versions

Solution 3 - asp.net

Get-Package -ProjectName "Your.Project.Name"

Will show the packages for the specified project.

See also: [Package Manager Console PowerShell Reference][1]

[1]: https://docs.nuget.org/consume/package-manager-console-powershell-reference "NuGet Powershell reference"

Note that each project will have a packages.config file which is used to track installed packages. If this is altered (specifically if you alter it backwards), the projects may not automatically download the correct package version. In that case, make a note of the packages required and do a uninstall-package, followed by a install-package for each.

Also, backups are your friend! ;)

Solution 4 - asp.net

If you have the .NET Core runtime installed, you can use the dotnet list package command in the .NET Core CLI tools to fetch installed packages for a given solution or project. Use it like so from the Windows command line:

dotnet list "C:\Source\MySolution\MySolution.sln" package

It works on both .NET Framework and .NET Core projects.

Note: For this command to work, the solution must use the new NuGet PackageReference format for referencing NuGet packages. Migration is as easy as right-clicking packages.config, and clicking "Migrate packages.config to PackageReference...", then restoring packages by building the solution.

Solution 5 - asp.net

In Visual Studio,

  • go to the Project or Solution in question
  • right click, Manage NuGet Packages...
  • on the left, you will see 'Installed Packages'
  • click on this and you will see the list

Solution 6 - asp.net

In addition to all of the given answers, there is also a clean listing in XML format of all installed packages in your Visual Studio project root folder: packages.config:

Enter image description here

Solution 7 - asp.net

Answer to "Is there a way to do this using nuget.exe? – bitbonk":

nuget list -Source C:/packages

Where C:/packages is a path to your local repository.

Solution 8 - asp.net

> How do I list all installed NuGet Packages?

Assuming that NuGet is properly installed

Right click Project node and click Manage NuGet Packages

Right click Project node

See installed packages list

See installed packages

Solution 9 - asp.net

Answer to "Is there a way to do this using nuget.exe?" – bitbonk

Based on the answer from jstar above. I used \ instead of / which fits more to the Windows environment where nuget is at home. My edit of the answer was rejected so I post my own.

nuget list -Source c:\code\packages

Where c:\code is a path to your local code-repository. The packages folder is on the same level like your solution-file (*.sln).

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionRhodopeView Question on Stackoverflow
Solution 1 - asp.netPhilip AllgaierView Answer on Stackoverflow
Solution 2 - asp.netbitbonkView Answer on Stackoverflow
Solution 3 - asp.netneilhighleyView Answer on Stackoverflow
Solution 4 - asp.netShahin DohanView Answer on Stackoverflow
Solution 5 - asp.netChristian PhillipsView Answer on Stackoverflow
Solution 6 - asp.netweckyView Answer on Stackoverflow
Solution 7 - asp.netjstarView Answer on Stackoverflow
Solution 8 - asp.netxameeramirView Answer on Stackoverflow
Solution 9 - asp.netKargWareView Answer on Stackoverflow