MEF (Managed Extensibility Framework) is a general programming approach in .NET to extend programs, like Visual Studio. VS packages / extensions can use the newer VS-MEF classes (contracts) instead of MPF classes. MEF is recognized by classes decorated with [Export]
attributes. Generally said, you inherit a specific class like a colorable item and export it to Visual Studio which then looks up all the exports in your MEF package and imports them.
MPF (Managed Package Framework) is like a class system around the older COM wrappers of the non-managed / native VS extension model. You programmatically extend Visual Studio by getting services and implement methods of MPF classes (the MPF classes in turn implement COM-like interfaces of the COM wrappers of VS. For example LanguageService
implements IVsLanguageInfo
and some other interfaces, but it just simply "collects" methods of those interface which you can then override in your LanguageService
implementing class).
If you want to implement a complete programming language, you will combine MPF and MEF. You use MEF for the editor parts like tokenization (which is needed for Syntax highlighting), outlining, brace matching etc. and MPF for the other VS stuff like new tool windows, property pages etc.
Instead of MPF you can also use the older COM wrappers, but the MPF classes already do some COM work for you which you would have to deal with if you choose the COM wrappers.
You can also implement the tokenizer etc. with MPF, but I tried it and find it much more un-intuitive than MEF. If you ask me, it's much harder, and requires more braindamage than MEF, but I have yet to get as far with MEF as I got with MPF.
It's a bit confusing to myself because MSDN mixes up articles of MEF and MPF as I noticed. You need to watch very carefully in which subsection of MSDN you go, you can easily switch from a MEF category to MPF by accident.
However, MSDN hints you about what-is-what in some general articles about extending VS, for example here: http://msdn.microsoft.com/en-us/library/cc138569.aspx