Find all dependencies of a single class

How do I automatically get a list of dependencies of a single .NET (C#) class with direct and indirect dependencies but excluding classes from 3rd party libraries?

I've tried VS and NDepend. With VS's Generate dependency graph it doesn't allow to pick a single class and I get a huge unmanageable graph with NDepend it includes dependencies from 3rd party libraries and I've not found an option to exclude those and keep the diagram at class level it forces me to switch to namespace or assembly level.


You can do this with Visual Studio Enterprise.

  • From the Architecture menu, choose New Diagram
  • Select Direct Graph Document
  • If you don't have any modeling project in your solution, you will be asked to create it
  • Drag and drop the class you are interested in from the solution explorer to the diagram area
  • Click Find all references
  • I use VS2013 so some nuance can be different (ie names in the context menu) but for sure you can do it also in VS 2010 and 2012.

    链接地址: http://www.djcxy.com/p/37736.html

    上一篇: 如何使用jquery从数组中删除空值

    下一篇: 查找单个类的所有依赖关系