Understanding MEF

Jun 26, 2014 at 11:31 PM
I just want to understand MEF in a comparison with the old plug-in style I have been using on a project.
I use source code written in C# or Visual Basic. When the application starts, it looks in the plugin folder and compiles the code into an appdomain (In memory dll). There is a plugin base that plugins inherit.
One of the problems of using that method is that when plugins are disabled, it disables the functionality, but does not remove it from the in memory dll. Also, when adding a new extension, the application has to be restarted so it can compile the source code again.

I am looking into switching to MEF, but I have a few questions.
  1. How does it discover plugins?
  2. Can It detect source code and compile it?
  3. Can I truly disable or unload a specific extension so that it is no longer in memory?
  4. Can I use event handlers from custom events that are in the business logic?
Thank you.