Advertisement
Guest User

Untitled

a guest
May 23rd, 2012
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. MEF loading plugins from a network shared folder
  2. <?xml version="1.0" encoding="utf-8" ?>
  3. <configuration>
  4. <runtime>
  5. <loadFromRemoteSources enabled="true"/>
  6. </runtime>
  7.  
  8. AssemblyName assemblyName = AssemblyName.GetAssembly();
  9. Assembly.Load(assemblyName);
  10.  
  11. <runtime>
  12. <loadFromRemoteSources enabled="true"/>
  13. </runtime>
  14.  
  15. string[] files = Directory.GetFiles(ClientPluginStore, "*.dll", SearchOption.TopDirectoryOnly);
  16.  
  17. AggregateCatalog aggCat = new AggregateCatalog();
  18.  
  19. aggCat.Catalogs.Add(catalog);
  20.  
  21. foreach ( string file in files )
  22. {
  23. Assembly ass = Assembly.LoadFrom(file);
  24.  
  25. AssemblyCatalog assCat = new AssemblyCatalog(ass);
  26.  
  27. aggCat.Catalogs.Add(assCat);
  28. }
  29.  
  30. _container = new CompositionContainer(aggCat);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement