I'm using MEF and the System.ComponentModel.Composition.dll to load some dll.
I'm doing something like :
AggregateCatalog catalog = new AggregateCatalog(new AssemblyCatalog(Assembly.GetExecutingAssembly()), new DirectoryCatalog(directory)); _container = new CompositionContainer(catalog); _container.ComposeParts(this);
to import my dll.
After some times, I would like to update my dll but if I try to delete it, I have an access denied, because it's alrealdy used by the program.
How can I release the dll, replace with a new dll and load the dll again ? (without closing the program)
Thanks in advance for your help