This project has moved and is read-only. For the latest updates, please go here.

Updating dll file in MEF,

Feb 29, 2012 at 7:40 AM

I have an application which loads plugin from a directory. I call plugin functions and it is working fine. Now i want to do that is when application is running i update a plugin dll. But when i try to delete it it says that is being used by the application. I am not able to delete is so that i can place updated dll file there.

How this can be done. Below is my code. Please do appropriate changes in my code.

public System.Lazy<ICalculatorIDictionary<stringobject>>[] CalciPlugins { getset; }
//Creating an instance of aggregate catalog. It aggregates other catalogs
var aggregateCatalog = new AggregateCatalog();
//Build the directory path where the parts will be available
var directoryPath = "Path to the dll folder";
//Load parts from the available dlls in the specified path using the directory catalog
var directoryCatalog = new DirectoryCatalog(directoryPath, "*.dll");
//Add to the aggregate catalog
//Crete the composition container
container = new CompositionContainer(aggregateCatalog);
// Composable parts are created here i.e. the Import and Export components assembles here
Mar 1, 2012 at 2:19 PM

i solved that issue with the information i found here:

read also the comments at the end...