C# 如何使用 ReSharper 列出解决方案中未使用的方法?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/15692456/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How can I use ReSharper to list unused methods in a solution?
提问by Micheal Wells
In a legacy ASP.NET project I have inherited, there are an abundance of methods defined which are used absolutely nowhere.
在我继承的一个遗留的 ASP.NET 项目中,定义了大量的方法,这些方法在任何地方都没有使用。
I'm familiar with the "Find usages" functionality, but would like to be able to generate a list of methods which are not called anywhere in the app. Does such functionality exist?
我熟悉“查找用法”功能,但希望能够生成未在应用程序中的任何地方调用的方法列表。是否存在这样的功能?
采纳答案by Gauthier G. Letellier
You can select ReSharper => Inspect => Codes Issues in solution ; And there, you can group by "Issue Type" and you should see all issues that match with "Type or type member is never used" (unused method goes there)
您可以在解决方案中选择 ReSharper => Inspect => Codes Issues ;在那里,您可以按“问题类型”分组,您应该看到与“从未使用过类型或类型成员”匹配的所有问题(未使用的方法在那里)
(And if you click right on it, you can select : "Show only "type or type member is never used" issues" .. and there you go ;)
(如果您右键单击它,您可以选择:“仅显示“从未使用过类型或类型成员”的问题……然后就可以了;)