【发布时间】:2011-06-13 18:02:03
【问题描述】:
我正在尝试实现一个接收类型并返回包含其基类型的所有程序集的方法。
例如:A 类是基类型(A 类属于程序集c:\A.dll)B 类继承自 A(B 类属于程序集c:\B.dll)C 类继承自B(C 类属于程序集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" }
}
我的主要问题是来自 Mono.Cecil 的 AssemblyDefinition 不包含像 Location 这样的任何属性。
在给定 AssemblyDefinition 的情况下如何找到装配位置?
【问题讨论】:
标签: c# reflection assemblies mono.cecil