9

I am looking at an abstract class in Visual Studio 2010's object browser. I would like to find all classes that descend from this abstract class so I can choose the best one to implement in my application. I do not have the source code for this assembly, so I can't use the find in files feature.

Unfortunately, I can't seem to find out how to do this at all. Visual Studio docs and Google just return completely irrelevant articles, so either I'm using the wrong terminology or this feature simply doesn't exist.

The best advice I've received is "analyse the assembly with redgate reflector", but surely there has to be a better way.

Thank you for your time.

Steve Rukuts
  • 9,167
  • 3
  • 50
  • 72
  • Possible duplicate of [Visual Studio: How do I show all classes inherited from a base class?](http://stackoverflow.com/questions/282377/visual-studio-how-do-i-show-all-classes-inherited-from-a-base-class) – Ozair Kafray May 17 '16 at 10:46

4 Answers4

7

You can use the Solution Explorer for this purpose: 1) Find base class in the Solution Explores (you can use search line). 2) Right click on the base class in the Solution Explorer 3) Click "Derived Types"

To return to the main Solution Explorer view click "Home" button in the top of the Solution Explorer.

Eugene Maksimov
  • 1,504
  • 17
  • 36
  • I think you mean the Solution Navigator. This got me what I needed, while staying in the VS toolset. Thanks! – JMD Oct 17 '13 at 19:28
  • Yes, for VS2010 it is "Solution Navigator" from the "Productivity Power Tools" extension. But in VS 2012 or VS 2013 this functionality is included in the "Solution Explorer". – Eugene Maksimov Oct 22 '13 at 08:03
  • Thx - Good to know where this is in VS 2013. IMHO, still less convenient than ReSharper's Type Hierarchy view, which shows all levels of the inheritance tree at one time, instead of forcing one to view just a tiny part of the info at one time. The "Is Used By" option of that VS menu looks potentially useful. Though again, ReSharper's "Usages of" has been much handier. Because can have multiple such searches open in tabs, switch back to a previous one easily. – ToolmakerSteve May 03 '14 at 05:05
5

On the "Browse" dropdown box of the Object Browser select an item other than "My Solution" or "All Components".

For example select ".NET Framework 4" or ".NET Framework 4.5"

jflaga
  • 4,610
  • 2
  • 24
  • 20
  • That doesn't seem to help in VS2012. Is that a 2010-only feature? – Chris Dolan Aug 14 '13 at 18:08
  • 1
    You also need to check the "Show Derived Types" in the "Object Browser Settings" dropdown located on the right side of the "Browse" dropdown – jflaga Sep 12 '13 at 11:51
  • I've used this before, I swear, but where did "Show Derived Types" go? I have all the other options, but not that one, in VS 2010 SP1. As a fallback, ILSpy is working nicely. I'd rather stay within the VS toolset by default though. – JMD Oct 17 '13 at 19:25
4

Install the Visual Studio Productivity Power Tools, then use its souped-up tooltip.

SLaks
  • 868,454
  • 176
  • 1,908
  • 1,964
  • Perfect - I moved my mouse over the class type, clicked "derived classes", it did some checking in the background and showed me the derived types. Thanks a lot. – Steve Rukuts Sep 02 '10 at 09:37
  • I added the Productivity Power Tools to VS 2012 Premium. I don't get the new tooltip, and I can't find anything about it in the docs for these tools (or in the VS2010 Power Tools docs): http://visualstudiogallery.msdn.microsoft.com/3a96a4dc-ba9c-4589-92c5-640e07332afd – Hawkeye Parker Apr 20 '13 at 00:20
  • 1
    @HawkeyeParker: This feature was removed in 2012. Sorry. – SLaks Apr 21 '13 at 01:31
1

If you want to conveniently navigate through a class hierarchy you won't be happy with the plain vanilla Visual Studio. Resharper and (I believe) CodeRush offer such a functionality. For the latter one there is a express edition, which is free. You can install all of them as Visual Studio Add-In.

Theo Lenndorff
  • 4,556
  • 3
  • 28
  • 43