c# - MEF doesn't discover exports in assembly loaded from byte[] -
i trying use mef application accepts plugins loaded database. when try creating new assemblycatalog
, pass in dynamically created assembly, mef appears unable discover exports
.
assembly = assembly.load(new assemblymover().getassemblybytes("plugin1")); assemblycatalog c = new assemblycatalog(a);
assemblycatalog
doesn't contain parts (but should).
if move exportable class current assembly run following:
assemblycatalog c = new assemblycatalog(assembly.getexecutingassembly());
mef discovers part fine (which assume).
the interface defined in shared assembly:
public interface iplugin { string name { get; } }
the assembly plugin1
has single class:
[export(typeof(iplugin))] public class testplugin1 : iplugin { public string name { { return "plugin1"; } } }
i thought mef used reflection discover parts, verified assembly loaded correctly , contained class testplugin1
.
foreach (type t in a.gettypes()) { messagebox.show(t.name); }
any thoughts?
Comments
Post a Comment