1

I am using a third party library in my application. That library may have 100+ classes.

I need to know that which all classes of that library i am using in my application.

Eg : Classes in library : A, B, C, D ,E, F......

and my application uses only C and D

So how could i know that my application uses C and D and only these classes.

Edit : Also if it could be possible to list down the properties of those classes used in the application.

Lucky
  • 123
  • 9
  • 5
    Have you looked at NDepend? http://www.ndepend.com/ – Jon Skeet Apr 30 '13 at 11:56
  • I have looked at the website for NDepend, and found that it is used for various things. To be more specific, are you trying to focus me on Dependency Matrix? – Lucky Apr 30 '13 at 12:02
  • if class C depends on B internally in library then do you want to include B in the list? – Parag Meshram Apr 30 '13 at 12:03
  • 1
    @ParagMeshram : Yes, dependencies will also has to be cosidered. Sorry, forget to mention that. – Lucky Apr 30 '13 at 12:05
  • 1
    You should check out [this question + associated answers](http://stackoverflow.com/questions/598129/dependency-graph-of-visual-studio-projects) for a good selection of possible solutions to your problem. While the question is project specific many of the tools and techniques described can also be applied to class dependencies across different assemblies. – Chris Neave Apr 30 '13 at 12:16

4 Answers4

1

If you have ReSharper, you can right-click on the reference in Solution Explorer and select "Find Code Dependent on Module". It'll show you a list sorted by the classes you depend on, so you could very quickly see which classes you're using in that assembly.

Joe White
  • 94,807
  • 60
  • 220
  • 330
0

Remove library reference, compile and see all errors. (Kind of a weird way, but works)

Daniel Möller
  • 84,878
  • 18
  • 192
  • 214
  • This is intrusive,:), you need to add reference back to make the program work? – David Apr 30 '13 at 11:57
  • First it would probably lead to many *namespace not found* errors, depending on the project size, that do not state which classes are missing... this answer isn't actually helpful, imho. – Carsten Apr 30 '13 at 11:58
0

Search in Files (CTRL + SHIFT + F) for the name of the library, you should be able to see wherever this library is used, whether by reflection or normal object initialising.

Has AlTaiar
  • 4,052
  • 2
  • 36
  • 37
0

Follow these steps -

  1. Remove library reference and try to compile.
  2. From Error tab identify and list classes which are showing as missing reference
  3. Use ILSpy ( or any familiar .NET assembly browser and de-compiler tool) add third party assembly to analyze.
  4. For identified classes in step 3, Right click on class on left panel and click Analyze in context menu like in below screenshot -

enter image description here

By using this you can further analyze all the dependent classes.

ILSpy download link

Parag Meshram
  • 8,281
  • 10
  • 52
  • 88