I am trying to implement a method that receives a type and returns all the assemblies that contain its base types.
For example:
Class A
is a base type (class A
belongs to assembly c:\A.dll)
Class B
inherits from A
(class B
belongs to assembly c:\B.dll)
Class C
inherits from B
(class C
belongs to assembly c:\c.dll)
public IEnumerable<string> GetAssembliesFromInheritance(string assembly,
string type)
{
// If the method recieves type C from assembly c:\C.dll
// it should return { "c:\A.dll", "c:\B.dll", "c:\C.dll" }
}
My main problem is that AssemblyDefinition
from Mono.Cecil does not contain any property like Location.
How can an assembly location be found given an AssemblyDefinition
?