I think i solved the Assembly.Load() problem by replacing it to Assembly.ReflectionOnlyLoad().
now this is how my method looks like:
public static IEnumerable<string> GetReferencesAssembliesPaths(this Type type)
{
yield return type.Assembly.Location;
foreach (AssemblyName assemblyName in type.Assembly.GetReferencedAssemblies())
{
yield return Assembly.ReflectionOnlyLoad(assemblyName.FullName).Location;
}
}
now the only left problem is the type.Assembly.GetReferencedAssemblies(), how do i get referenced assemblies from the type rather than from the assembly?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…