2

如何自动获取具有直接和间接依赖关系但不包括来自 3rd 方库的类的单个 .NET (C#) 类的依赖关系列表?

我试过VS和NDepend。使用 VS 的生成依赖关系图,它不允许选择单个类,并且我使用 NDepend 得到一个巨大的无法管理的图,它包括来自 3rd 方库的依赖关系,我还没有找到排除这些依赖关系并将图表保持在类级别的选项迫使我切换到命名空间或程序集级别。

4

1 回答 1

2

You can do this with Visual Studio Enterprise.

  1. From the Architecture menu, choose New Diagram
  2. Select Direct Graph Document
  3. If you don't have any modeling project in your solution, you will be asked to create it
  4. Drag and drop the class you are interested in from the solution explorer to the diagram area
  5. Click Find all references

I use VS2013 so some nuance can be different (i.e. names in the context menu) but for sure you can do it also in VS 2010 and 2012.

于 2014-03-27T17:47:22.063 回答