MEF seems annoying

Jun 21, 2011 at 5:59 AM

In the structure of Prism, we should have

1 project for main window/bootstrapper,

1 project for every module

1 project for common classes shared by those modules.

If we use MEF, we need to add AssemblyCatalog for each assembly. that means main window/boostrapper project needs to reference all projects

regardless if it is really necessary.

Any solution to this?



Jun 21, 2011 at 9:22 PM


It’s not necessary to hold references to your modules in your shell project. The MefBootstrapper initializes the MEF catalog, and by placing the ModuleExport attribute on the IModule in your module’s projects, the exports for these projects are included in the MEF catalog, regardless of how the module’s project was loaded.

You might find more information about this in this section of the Modularity Chapter in the Prism MSDN documentation.

You can also check this in the Modularity QuickStarts provided with Prism v4.


Miguel Bronzovic