Home: Analyze unused NugetPackages

Created on 10 Oct 2019  路  13Comments  路  Source: NuGet/Home

_This issue has been moved from a ticket on Developer Community._


Would be awesome if VS 2019 had a feature to go through and analyze unused nuget package references. Please disregard if this is something that is already in the works. As a developer, this feature would make maintenance a lot easier.


Original Comments

Jane Wu [MSFT] on 9/27/2019, 00:04 AM:

Thank you for taking the time to provide your suggestion. We will do some preliminary checks to make sure we can proceed further. We鈥檒l provide an update once the issue has been triaged by the product team.

Roslyn Backlog 2 External Feature

Most helpful comment

All 13 comments

From https://developercommunity.visualstudio.com/content/idea/749754/nuget-utilization-tool.html:

During development I have found that I load numerous NuGet packages, some of which may not end up being actually utilized. It would be nice to have a tool to be able to identify them and then uninstall them to reduce the number of final application/library components and the application/library size. This concept might also be applied to references to other libraries from SDK's and other sources.

NuGet does not really know whether assemblies were used or not, only the compiler knows that, so it's a wide reaching feature.

I love the idea, NuGet just can't do this alone.

Another related feature is to show NuGet package usage in the project i.e. showing code references where package APIs are used

roslyn would be the partner for something like this :)

When I suggested the concept might be applied to references to other libraries from SDK's and other sources, I was not suggest the NuGet tool do it but a different tool, or perhaps incorporating the process into the code analysis and clean up tool..

@alaskanrogue Thanks for the suggestion. I feel this will be an helpful feature. We would love to get more customers chime in on this ask.

In the meantime, I will try to find if there were similar asks on other repos/areas of VS.

@nkolev92 can you tag folks from partner teams here (that you know)

Maybe @tmat @jinujoseph @sharwell can help.

I know it's been discussed in the past, but it's not easy considering the compiler operates on assemblies while NuGet operates on packages.

Given a NuGet is a package of assemblies providing an API, there isn't really any difference. Just that the tool needs to add their APIs in addition to the direct reference APIs to create the checklist to be subsequently checked off during the analysis. It really shouldn't need to use full compilation to perform the analysis, just the code review.

@anangaur
Do you want to keep this open on our end for tracking or dup it in favor of that?

Let鈥檚 keep it at our end too. May be put an appropriate tag.

Think this issue is related to or a duplicate of https://github.com/NuGet/Home/issues/6284

Was this page helpful?
0 / 5 - 0 ratings