Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MEF loading plugins from a network shared folder
- <?xml version="1.0" encoding="utf-8" ?>
- <configuration>
- <runtime>
- <loadFromRemoteSources enabled="true"/>
- </runtime>
- AssemblyName assemblyName = AssemblyName.GetAssembly();
- Assembly.Load(assemblyName);
- <runtime>
- <loadFromRemoteSources enabled="true"/>
- </runtime>
- string[] files = Directory.GetFiles(ClientPluginStore, "*.dll", SearchOption.TopDirectoryOnly);
- AggregateCatalog aggCat = new AggregateCatalog();
- aggCat.Catalogs.Add(catalog);
- foreach ( string file in files )
- {
- Assembly ass = Assembly.LoadFrom(file);
- AssemblyCatalog assCat = new AssemblyCatalog(ass);
- aggCat.Catalogs.Add(assCat);
- }
- _container = new CompositionContainer(aggCat);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement