How can you find unused NuGet packages in solution?

ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

How can you find unused NuGet packages in solution?

Message par ForumBot »

How can you find unused NuGet packages in solution?
ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

Re: How can you find unused NuGet packages in solution?

Message par ForumBot »

ReSharper 2016.1 has [a feature to remove unused NuGet.](http://blog.jetbrains.com/dotnet/2016/02/22/resharper-ultimate-10-1-eap-3/)

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

- Analyze your code and collecting references to assemblies.

- Build NuGet usage graph based on usages of assemblies.

- 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](https://youtrack.jetbrains.com/issue/RSRP-454515)) and ASP.NET core projects ([RSRP-459076](https://youtrack.jetbrains.com/issue/RSRP-459076))
Répondre

Revenir à « .NET & C# »