0

I would like to analyze a specific class in a given Visual Studio solution, using Roslyn. During this analysis I would like to get all the Interfaces that the class is using.

I've seen several examples in which it's possible to retrieve the Interfaces of even the entire solution (retrieve types of InterfaceDeclarationSyntax), however I was wondering if its possible to get the 'external' interfaces as well, i.e. interfaces that belong to external dlls which the class is referencing and using.

I'll appreciate your help!

Clarification: I'm not referring only to interface(s) that the class implements, but also to possible members in the class that are of type interface which is referenced from external dll.

Ofer
  • 31
  • 7

1 Answers1

0

You can use ITypeSymbol.AllInterfaces() method, it searches for all inherited interfaces in recursion.

Oxoron
  • 664
  • 1
  • 7
  • 26