Выгрузка файла dll в mef

У меня есть несколько плагинов в виде DLL-файлов. Мое приложение загружает dll и работает нормально. но когда я пытаюсь удалить старый плагин и заменить его новым плагином, он не позволяет мне это сделать. как это было загружено приложением. Я обнаружил, что с помощью appdomain мы можем это сделать. но я не могу найти решение, в котором используется mef.

Мне нужен код, который может работать на Mef. Ниже мой код, который используется для загрузки плагинов.

//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 plugins 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
aggregateCatalog.Catalogs.Add(directoryCatalog);

//Crete the composition container
var container = new CompositionContainer(aggregateCatalog);


// Composable parts are created here i.e. the Import and Export components assembles here
container.ComposeParts(this);

Ответы на вопрос(2)

Ваш ответ на вопрос