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.
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.
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.
Get-Package
, packages' names are trimmed when they have more than 32 characteres. Is it possible to increase the package name column so that the output show the full names without trimming them?
Mar 16, 2017 at 12:44
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
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.
Get-Package -ProjectName "Your.Project.Name"
Will show the packages for the specified project.
See also: Package Manager Console 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! ;)
In Visual Studio,
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:
packages.config
file. See Microsoft documentation.
Apr 14, 2020 at 14:29
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.
How do I list all installed NuGet Packages?
Assuming that NuGet is properly installed
Right click Project node and click Manage NuGet Packages
See installed packages list
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).