How can you find unused NuGet packages in solution?

ReSharper 2016.1 has a feature to remove unused NuGet.

It can be run on a solution and on each project in a solution and it does the following things:

  1. Analyze your code and collecting references to assemblies.
  2. Build NuGet usage graph based on usages of assemblies.
  3. Packages without content files, unused itself and without used dependencies are assumed as unused and suggested to remove.

Unfortunately, this doesn’t work for project.json projects (RSRP-454515) and ASP.NET core projects (RSRP-459076)

Leave a Comment