How to get a list of classes with 0 references from CodeLens

混江龙づ霸主 提交于 2019-12-12 12:21:26

问题


I have a very big EF edmx model with over 450 classes/entities. This has grown organically over the last 5 years. With Visual Studio 2013 and the CodeLens feature I have noticed that some classes have 0 references listed. When I do some research I have found that this is true and I can remove that entity from the model.

The problem is that I would have to look at all 450 classes in the edmx to see if CodeLens says there are 0 references. Is there any report, export that I can get with CodeLens? Is there any way to extend it to provide this if there is no report?


回答1:


Is CodeLenses requirement? I found several things that can help you:

  • Code analysis
  • NDepend
  • Resharper

Here are some links: - http://blogs.msdn.com/b/habibh/archive/2009/07/31/discover-dead-code-in-your-application-using-code-analysis.aspx - Find unused classes in a .net project - https://stackoverflow.com/questions/1413548/visual-studio-find-unused-code



来源:https://stackoverflow.com/questions/21124513/how-to-get-a-list-of-classes-with-0-references-from-codelens

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