CompositionContainer
CompositionContainer is a central component of the Managed Extensibility Framework (MEF) in the .NET ecosystem. It acts as the runtime engine that performs the composition of parts by matching imports and exports declared across a set of catalogs. Parts are classes that expose capabilities via exports and declare dependencies via imports. The container resolves these dependencies and wires parts together so that consumers can obtain the required services.
Catalogs provide the universe of available exports. Common types include AssemblyCatalog (discovering parts in a single
Usage patterns include creating a container and calling ComposeParts or SatisfyImportsOnce to satisfy the imports of
CompositionContainer implements IDisposable and releases resources when disposed. It supports extending or customizing the hosting environment