This project has moved. For the latest updates, please go here.

MEF Catalog one-time initialization for several Components.

Dec 16, 2010 at 11:26 AM


I would like to use MEF in .NET 4.0. The Project contains tha main project, contract assembly and several other assemblies (.net class libraries) that implements the contracts. These assemblies use MEF [Import,Export] Attributes heavily.

In main project i would like to load and initialize the compositioncontainer, but it seems that i have to initialize the container in every class that uses MEF. Can i initialize the container only once and let other assmblies reuse that container? Or at least use something similiar as in Silverlight CompositionInitializer.SatisfyImports(this) in class constructor?


Kind Regards