Chapter 53

Managed Extensibility Framework (MEF)


  • Architecting extensible applications
  • Hosting the Managed Extensibility Framework in your applications
  • Understanding the Visual Studio 2012 Editor components
  • Extending the Visual Studio 2012 Editor
  • Importing Visual Studio Services

Creating loosely coupled applications that can be extended after deployment can be a difficult process. You have many design decisions to make, including identifying and loading extensions that have been deployed, and making application services available to loaded extensions. The Managed Extensibility Framework (MEF) is an open source library created by Microsoft designed to reduce the complexity of creating extensible applications. It enables you to expose reusable parts of your application to plug-ins or extensions that are discovered and loaded at run time and design your application in a loosely coupled fashion.

Visual Studio 2012 uses the MEF library to provide extension points for the main editor control. It is expected that in future versions of Visual Studio, more areas will be exposed for this kind of extension.

This chapter is split into three sections. The first section is an introduction to how MEF works and how to use it in your own applications. The middle section describes the components of the Visual Studio 2012 Editor control and how they interact. The final section describes the process of extending the editor with MEF and provides a complete sample that emphasizes ...

Get Professional Visual Studio 2012 now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.