删除未使用的引用 [英] Remove unused references

查看:91
本文介绍了删除未使用的引用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否存在用于删除.NET C#项目中未使用的引用(未使用的using指令)的工具.

I want to know if any tool exists for removing unused references (not unused using directives) within a .NET C# project.

推荐答案

我不知道这种工具很重要-我知道Visual Studio默认不包含一个工具.但是,C#编译器会从已编译程序引用的程序集列表中自动删除项目中代码未实际使用的引用程序集.如果您使用 Reflector ,则可以将实际参考文献列表与参考文献列表进行比较在项目中,并根据此内容删除项目中不必要的内容.

I am unaware of such a tool off the top of my head - I do know that Visual Studio does not include one by default. However, referenced assemblies that are not actually used by code in the project are automatically removed by the C# compiler from the list of assemblies referenced by the compiled program. If you use Reflector, you can compare the list of actual references to the list of references in the project, and remove the unnecessary ones that the project includes based on that.

这篇关于删除未使用的引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆