Find “Dead code”

旧城冷巷雨未停 提交于 2019-12-03 08:39:55

The rule CA1811: Avoid uncalled private code perfectly works fine to detect the uncalled private methods.

To enable the code analysis warnings, you also need to set this value in project properties like this -

As a suggestion it is good idea to have our custom ruleset, to have more control over rule violations for example you can define any violation as error, so that you can get it as compile error and fix it.

In case you are OK with a command line utility, I suggest the Resharper Command Line tool. It can do many great things that will help you, including finding dead code. It's free (Resharper VS extension is not) so it will get you going.

If Resharper can't find any dead code, maybe there's none and Code Analysis does work :-)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!