mercredi 8 mars 2017

Single .dll with MEF

With reflection i can load a single dll.

Assembly testAssembly = Assembly.LoadFile(@"c:\Test.dll");

But with MEF all the plugins in the directory are red. Is there a way with MEF of doing the same ?

I can do this :

public IPlugn Load(string name)
    {
        return Plugins
          .Where(l => l.Name.Equals(name))
          .FirstOrDefault();
    }

but this is a based on the the whole list of plugins.

Kind regards

Dipke





Aucun commentaire:

Enregistrer un commentaire