Creating more than one module class (using ModuleExport) in the assembly (good for simple deployment as default implementation in core modules) and configuring only one module to be loaded (from the app.config)
causes all modules to be resolved by MEF. Even if the module doesn’t appears in the app.config.
1. What if I want to load only one module in an assembly contains more than one module? I think that there should be an option to choose the specific module to load from the configuration file and not the all assembly
2. It seems to be more reasonable to have modules when using unity instead of MEF for resolving and registering types such as services (at least in current Prism/MEF modularity version). Part of the module job is
to register types that may be consumed later. Loading module using MEF is pointless in current version, since having exports in the same assembly causes MEF to load each on demand (for example having an import elsewhere). I think that part of the module functionality
is to decide what type to export, hence I think that there should be a way exporting types as module load.
class Service : IService
class Module : IModule
// TODO : Register exports with MEF here so only registered export could be imported.