Tool to Show Class Hierarchies in .NET
Solution 1
I second Marc's recommendation of .NET Reflector - and would like to add that there is an impressive series of add-in available at CodePlex.
Just a few of the add-ins I use with regularity:
- Deblector - This add-in allows to debug processes from within Reflector.
- Graph - This add-in draws assembly dependency graphs and IL graphs.
- DependencyStructureMatrix - Allows you to create and browse dependency structure matrices.
- AutoDiagrammer - This add-in draws class diagrams.
- CodeModelViewer - This add-in shows the underlying code model objects for selected items.
Solution 2
The Resharper visual studio plugin also has a View Type Hierarchy feature along with its many other great features.
Solution 3
You can use the Object Browser inside Visual Studio:
The Object Browser lets you select and examine the symbols available for use in projects. You can open the Object Browser from the View menu, or by clicking the Object Browser button on the main toolbar.
In the Objects pane, icons identify hierarchical structures such as .NET Framework and COM components, namespaces, type libraries, interfaces, enums, and classes. You can expand these structures to reveal ordered lists of their members. Properties, methods, events, variables, constants, and other contained items are listed in the Members pane. Details on the item selected in the Objects pane or Members pane appear in the Description pane.
Solution 4
Reflector will do this (and is free). Find the interface, and expand the "Derived Types" node in the tree.
Alternatively, the "Class Diagram" project item in Visual Studio should do it, but I like the clean nature of Reflector.
Solution 5
I found this Resharper function handy to show only type hierarchy. Something close to what eclipse offers (F4 - Open type hierarchy) Select parent class then Right click on VS editor and select 'find usages advanced' and select 'derived types' checkbox (or) hit CTRL + ALT + SHIFT F12 to show search properties window
Hosam Aly
I'm interested in developing top quality software, optimizing performance, refactoring code, and learning about core computer science topics. For more information about me, please check my LinkedIn profile. I'm currently available for contracts, preferably using Scala or Ruby (outside finance, media, fashion, and advertising).
Updated on June 17, 2022Comments
-
Hosam Aly about 2 years
Is there a way/tool that could show me all the classes/interfaces that implement a certain interface in my project? In Eclipse (Java) I would use the context menu "Open Type Hierarchy" option, which would show me a (pretty) tree of types that extend the selected type. Is there a tool to do the same in .NET?
-
Marc Gravell over 15 yearsTo get started, use File->Open... and open your project dll(s)
-
Marc Gravell over 15 yearsBut not sub-types / implementing-types
-
Hosam Aly over 15 yearsResharper certainly looks like a good tool, but it's not free. I come from a Java background, so I'm used to getting all the nice goodies for free. :D
-
Mike Two over 15 yearsThat's true. I also come from a Java background, and I found that some of the nicer goodies in Java aren't free either. I always preferred the IntelliJ IDE to Eclipse. Sometimes you get what you pay for. Resharper saves me so much time it is worth the money.
-
Hosam Aly over 15 yearsReflector did exactly what I needed. Thanks. By the way, the Class Diagram Editor wouldn't have worked for me, because I wanted to check all derived types of a system class.
-
jnnnnn almost 13 yearsImplementing types can be found using popup->Find All References.
-
Iman almost 12 yearsthanks, RightClick -> Inspect ->Type Hierarchy or Ctrl+E, Ctrl+H
-
Steve Chambers about 11 yearsA deficiency here is the "Find All References" method doesn't work when the class is part of the .Net language. E.g. right now I'd like to find a class that implements
System.Web.Routing.RouteBase
. Am aware I can go into Internet land to find that out but it would be nice if it were possible within Visual Studio - preferably without having to use a third party tool. -
Steve Chambers about 11 yearsReflector may have been free at the time this was written but doesn't look like it is now.
-
ekkis almost 11 yearsjust a note that .NET Reflector is not open source. it's now owned by RedGate and costs $