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
I am looking into switching to MEF, but I have a few questions.
- How does it discover plugins?
- Can It detect source code and compile it?
- Can I truly disable or unload a specific extension so that it is no longer in memory?
- Can I use event handlers from custom events that are in the business logic?