Managed Extensibility Framework
Managed Extensibility Framework (MEF) is a component of .NET Framework 4.0 aiming to create lightweight, extensible applications.[src] It aims to allow .NET application developers to discover and use extensions with no configuration required.[src] It also aims to let extension developers encapsulate code easily and avoid fragile hard dependencies.[src] Furthermore, it aims to allow extensions to be reused across applications.[src] MEF was introduced as a part of .NET 4.0 and Silverlight 4.[src] It was later improved with the release of .NET 4.5 by adding support for generic types and the introduction of a convention-based extension model.[src]
Managed Extensibility Framework (MEF) is a component of .NET Framework 4.0 aiming to create lightweight, extensible applications.[src] It aims to allow .NET application developers to discover and use extensions with no configuration required.[src] It also aims to let extension developers encapsulate code easily and avoid fragile hard dependencies.[src] Furthermore, it aims to allow extensions to be reused across applications.[src] MEF was introduced as a part of .NET 4.0 and Silverlight 4.[src] It was later improved with the release of .NET 4.5 by adding support for generic types and the introduction of a convention-based extension model.[src] ==Overview== MEF aims to solve the runtime extensibility problem.[src] Without MEF, any application that wants to support a plugin model needs to create its own infrastructure from scratch.[src] Those plugins will often be application-specific and cannot be reused across multiple implementations.[src] MEF aims to provide a standard way for the host application to expose itself and consume external extensions.[src] Extensions, by their nature, could be reused amongst different applications.[src] However, an extension can still be implemented in a way that is application-specific.[src] Extensions themselves can depend on one another and MEF aims to make sure they are wired together in the correct order, sparing the developer from doing it manually.[src] MEF offers a set of discovery approaches for the application to locate and load available extensions.[src] MEF allows tagging extensions with additional metadata which aims to facilitate rich querying and filtering.[src] ==Design== Roughly speaking, MEF's core consists of a catalog and a CompositionContainer.[src] A catalog is responsible for discovering extensions and the container coordinates creation and satisfies dependencies.[src] MEF's first-class citizen is the ComposablePart class.[src] A composable part offers up one or more Exports, and may also depend on one or more externally provided services or Imports.[src] A composable part also manages an instance, which can be an object instance of a given type (it is in the default MEF implementation) .[src] MEF, however, is extensible and additional ComposablePart implementations can be provided as long as they adhere to the Import/Export contracts.[src] Exports and imports each have a Contract.[src] Contracts are the bridge between exports and imports.[src] An export contract can consist of further metadata that can be used to filter on its discovery.[src] For example, it might indicate a specific capability that the export offers.[src] MEF's container interacts with Catalogs to have access to composable parts.[src] The container itself resolves a part's dependencies and exposes Exports to the outside world.[src] Composable part instances may be added directly to the container.[src] A ComposablePart returned by a catalog will likely be an extension to the application.[src] It might have Imports (dependencies) on components the host application offers, and it's likely to Export others.[src] The default MEF composable part implementation uses attribute-based metadata to declare exports and imports.[src] This allows MEF to determine which parts, imports, and exports are available through discovery.[src] ==References== ==Further reading== ==External links== Managed Extensibility Framework Overview Building Composable Apps in .NET 4 with the Managed Extensibility Framework Gentle Introduction to MEF - Part One[src]
39 sentences · 39 cited inline · 0 references stored
References
No reference rows published for this article.
Cite this article
MLA
"Managed Extensibility Framework." encyclopegia.org, 2025, https://encyclopegia.org/wiki/managed-extensibility-framework. Accessed 26 November 2026.
Chicago
"Managed Extensibility Framework." encyclopegia.org. Accessed November 26, 2026. https://encyclopegia.org/wiki/managed-extensibility-framework.
APA
encyclopegia.org. (2025). Managed Extensibility Framework. Retrieved November 26, 2026, from https://encyclopegia.org/wiki/managed-extensibility-framework
Accessed November 26, 2026 · CC BY-SA 4.0 · citation page · JSON