您如何在解决方案中找到未使用的NuGet软件包? [英] How can you find the unused NuGet packages in a solution?
问题描述
如何找到解决方案中未使用的NuGet软件包?
How can you find the unused NuGet packages in a solution?
我有很多解决方案,其中已安装的软件包很多,很多都标记为具有更新.
I've got a number of solutions where there are a lot on installed packages, and a large number are flagged as having updates.
但是,我担心可能会有重大更改,因此我首先要删除所有未使用的软件包进行清理.
However I'm concerned there may be breaking changes, so I first want to clean up by removing any unused packages.
推荐答案
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:
- 分析您的代码并收集对程序集的引用.
- 根据程序集的用法构建NuGet使用图.
- 不包含内容文件,未使用的自身和未使用的依赖关系的软件包被视为未使用并建议删除.
不幸的是,这不适用于project.json
项目( RSRP-454515 )和ASP.NET核心项目( RSRP-459076 )
Unfortunately, this doesn't work for project.json
projects (RSRP-454515) and ASP.NET core projects (RSRP-459076)
这篇关于您如何在解决方案中找到未使用的NuGet软件包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!