MEF CTP 1 Released

Several members of my team have already spilled the beans, but yes (!) we just released our first public preview of MEF. You can grab the bits from here and read a past post for a high level overview.

I am super excited about the release. It’s a very early preview and still lots of work remains, but the CTP is a significant milestone for us. Designing a general purpose extensibility framework is hard, and so we felt very strong about releasing such an early preview to the world to get early feedback from the community. Hopefully together we can create a set of APIs that scale to the variety of extensibility scenarios: from developers using DI and IoC to large applications with extensibility points and plug-ins.

In my previous post about MEF, several people asked about constructor injection and non-attribute based programming model. Constructor injection is not supported in this preview, but we did start working on the design of the composition engine that would allow it. The non-attribute based programming model (where connections are specified externally) is actually enabled, but not built-in. I will try to post a sample showing how to do it, but for those that want to experiment themselves: you need to implement a custom component binder. The built-in binder inspects types and looks for the attributes. You custom binder might want to read the same information (which type to inject where) in some external file.

Comments (8)

  1. Vagif Abilov says:


    Can you emphasize what are the principle differences between MEF and Unity DI framework from Enterprise Library? AFAIK Unity also supports attribute-based dependency setup.

  2. Krzysztof Cwalina  MEF CTP 1 Released (소식) Managed Extensibility Framework – Home (메인페이지) Managed

  3. Martin Bohring says:

    Hello Krzysztof,

    it is nice to see those efforts from Microsoft.

    But something is not very clear for me.

    How is the relation between MEF and MAF ? How does the Unity application block from P&P fit into this new landscape ?

    Please feel the pain of all the SW architects trying to base their new architectures onto somethings that is future proof.

    This really becomes more difficult from day to day.

    I don’t mean to bash onto those projects, but a bit more coordinated efforts would be much appreciated.

    How is the big picture and design rational of all those somehow releated sub frameworks

  4. Krzysztof Cwalina announced that Microsoft has released a CTP of its Managed Extensibility Framework

  5. Krzysztof Cwalina a annoncé la première CTP public de Managed Extensibility Framework (MEF) . Pour faire

  6. Krzysztof Cwalina announced first public Managed Extensibility Framework (MEF) CTP . What's this

  7. public class HelloWorld { [Import] // import declares what a component needs public OutputDevice Output;

  8. Hey Kzysztof.

    when I first read your first  blog entry about MEF (  and your example at the end of it I was actually a bit confused, too.

    Seeing a container and some bootstrapping at application startup reminded me of a lot of samples I’ve seend from different IoC – containers. Reading more and more comments to that post my confusion even grew. I was asking myself: "Why are they building yet another IoC container?"

    However, after downloading the CTP and reading though the code I guess (at least for me) the example shown in the blog entry was a bit misleading.

    We are talking about dynamic application extensibillity, right? Dynamic in the sense of dynamic discoverabillity and dynamic binding which seem to be core aspects of MEF (as least as I interpret it). If so, an example only showing bootstrapping at application startup is confusing because it reminds most people of a plain old IoC-container.

    From what I’ve seen so far MEF and IoC-containers serve a completly different purpose. MEF is not trying to be an IoC-container or an application composition framework. It’s primary purpose is to enable easy third party extensibillity and integration. Dependency Injection is only an implementation aspect of MEF, not the purpose of the framework.  

    That beeing said I very much liked the Calculator example in the CTP because it demonstrates quite well, how MEF could be beneficial in real world scenarios.

    On the feature side I would be very happy if the team could realize constructor injection for extensions.

    To conclude this : I really appreciate what your team is trying to achive and I am looking forward to extensibillity features in the next .NET-Framework . . .