I read all the many posts here on Stackoverflow about how to use MVC with MEF, and there are links to them, but I did not find the answer to all the questions, and on the Internet I was looking for how to create plugins with MEF that can include, shutdown, installation and removal from the administrator settings page.
I am trying to create my own CMS for MVC and would like to use MEF as part of my plugin infrastructure.
You just need to know how to programmatically install, uninstall, enable and disable plugins created for MEF.
After thinking of writing "plugins" for using MEF, then pack it in Nuget, where you can install and remove it from the administrator settings page.
Nuget will be responsible for installation and removal.
MEF will be responsible for registering the plugin, as well as some on and off options.
An example of a situation:
User installs CMS
The user goes to the admin section โ Plugins
The user sees a list of plugins that they can install and use for CMS
The user clicks โInstallโ and the MEF plugin is installed in the CMS
User Click "Enable" and the MEF plugin is ready for use by the system
The user wants to temporarily disable the plugin, the user clicks the "Shut Down" button
The user no longer needs the plugin and clicks "Delete", and the plugin is completely removed from the CMS.
The user understands that he accidentally deleted the wrong plug-in, the user clicks โInstallโ again.
The goal is to be able to manage the plugins on the settings page of the administrator type, since the ability to install, remove, enable and disable would be a great feature in the CMS.
I know that other CMS use this type of function for their plugins, but I do not know a single one that uses MEF as part of its platform for this.
Most use their own internal plugins for these functions.
I hope I can use the MEF framework to help do this.
Another goal is to basically have a system where plugins designed for MEF and packaged in Nuget can be hosted somewhere like Nuget.org.
In the Nuget package, along with MEF, everything a plugin needs is in the Nuget package.
But since it uses MEF, this package can technically only contain 1 DLL, and when the user installs the Nuget Package, MEF will register the DLL on its website.
An example is a blog that comes with everything you need.
The user goes into the Visual Studio Install Nuget Package "Blog" and installs 1 DLL, which contains everything that he needs.
MEF will register the package on the user's website and thatโs it.
No settings or anything on the user side.
Just pull and install from Nuget and that's it :)