Is MEF or MEF2 baked into the .NET Framework?
Asked Answered
S

1

10

I am trying to understand MEF and I am seeing references to MEF and MEF 2.

This site lists MEF2 as being much faster than MEF (4.0).

I need to understand what I am talking about when most people say MEF.

So which is in the .NET Framework 4.5? MEF or MEF2?

Spike answered 2/11, 2015 at 18:27 Comment(0)
C
13

Well to make it even more confusing Microsoft released three versions of MEF using two only unique names: MEF and MEF2

  • System.ComponentModel.Composition.* MEF in .NET 4 (typically called just MEF), no support for CompositionScopes, ExportFactories, etc
  • System.ComponentModel.Composition.* MEF2 in .NET 4.5 (sometimes called MEF2 or MEF), support for composition scopes, ExportFactories
  • System.Compostion.* from independent package Microsoft.Composition lightweight version of MEF typically called MEF2

The benchmark site refers to lightweight MEF2 System.Compostion.* from Microsoft.Composition package.

Cynosure answered 4/11, 2015 at 12:41 Comment(2)
There's also another one (latest as at April 2019) called VS-Mef. This would probably be the one to use, as its claimed to be the fastest of all the MEF versons, and more widely compatible with the now-many .NET version families.Melanimelania
VS Mef shows only better performance at startup: github.com/danielpalme/IocPerformance/issues/120Statutory

© 2022 - 2024 — McMap. All rights reserved.