Questions tagged [mef2]

Microsoft Extensibility Framework (MEF) simplifies the design of extensible and modular applications.

Microsoft Extensibility Framework (MEF) simplifies the design of extensible and modular applications. Version 2 is available from .Net 4.5 and includes Dependency Injection.

30 questions
11
votes
2 answers

What is included in MEF 2?

I see work is still going on with new features on MEF (MEF Codeplex site) and they are shipping MEF 2 beta releases, however they do not have any decent documentation on what the new features are experimenting/exploring/building? So, what are the…
Robert MacLean
  • 38,975
  • 25
  • 98
  • 152
9
votes
1 answer

Is MEF or MEF2 baked into the .NET Framework?

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…
Vaccano
  • 78,325
  • 149
  • 468
  • 850
6
votes
2 answers

How to properly scope composition per request using ASP.NET MVC, WebAPI, and MEF

I recently added MEF to an MVC/WebAPI application using a variety of resources including this SO answer How to integrate MEF with ASP.NET MVC 4 and ASP.NET Web API. While this worked for a time, I started to receive intermittent errors related to…
Robb Vandaveer
  • 1,481
  • 20
  • 25
5
votes
2 answers

MEF2 how does the catalogs work? Looks like it's been removed

I can't find any good examples on MEF2. I would like to create a plugin directory and use a directory catalog to load up Imports. What I would like: No attributes. Use of the Configuration Builder with Conventions Plugin directory When a dll is…
Chris Kolenko
  • 1,020
  • 17
  • 32
4
votes
1 answer

MEF2 how to get metadata from CompositionHost export with convention based imports

This is my first SO question so please bear with me... I am trying to load components with MEF2 using the ConventionBuilder class. Everything works as excpected until I need to access metadata that is available as attributes on a imported type.…
SBeltz
  • 41
  • 3
4
votes
2 answers

Composing Open Generic Types with Closed Types in MEF 2

I understand that starting with MEF 2, MEF supports composing open generic types into closed types. I'm trying to compose a closed type from types exported from two different assemblies added to the same composition container and I'm receiving an…
Robb Vandaveer
  • 1,481
  • 20
  • 25
3
votes
2 answers

How to set CreationPolicy singleton in .net-core System.Composition (Mef)

I am converting a DNX project to .net core. Because of dependency changes, I cannot use System.ComponentModel.Composition anymore, instead must use .net core's ported version System.Composition (which I believe is known as MEF 2). However I could…
user3517546
  • 133
  • 1
  • 9
3
votes
1 answer

Why does MEF2 not apply metadata attributes to all part exports?

I'm trying to port a collection of .NET Framework-based applications to .NET Core, and as part of this process I need to switch from using MEF1 to MEF2. I've been having a lot of difficulty wrapping my head around issues relating to MEF2 (though…
Tagc
  • 8,736
  • 7
  • 61
  • 114
3
votes
0 answers

Register instance with mef2 in uwp

I downloaded the nuget package Microsoft.Composition and tried to register a service with mef2. It seems the whole framework changed. CompositionContainer, AggregateCatalog and the RegistrationBuilder are gone. The CompositionContainer seems to be…
Briefkasten
  • 1,964
  • 2
  • 25
  • 53
3
votes
2 answers

How to implement Dependency Injection with MVC5 and MEF2 (Convention-Based) in an n-tier application?

I'm starting a new MVC project and have (almost) decided to give the Repository Pattern and Dependency Injection a go. It has taken a while to sift through the variations but I came up with the following structure for my application: Presentation…
3
votes
1 answer

Resolving HttpRequestBase in MEF

I'm pretty new to MEF, I always used to use autofac, which automatically registers all the "Web Request"-scoped objects in the life time scope of the Request, so you can always resolve HttpRequestBase and similar objects in dependencies. Is there a…
Wiebe Tijsma
  • 10,173
  • 5
  • 52
  • 68
3
votes
1 answer

Mef2 Configure Registrations in each module

Ok so I am using Caliburn Micro and Mef2 in a C# WPF app using .Net 4.5. I am wondering if there is any way I can configure my registrations for Mef2 inside of the separate dlls and then use them inside my main dll. Basically the dll will configure…
twreid
  • 1,453
  • 2
  • 22
  • 42
2
votes
1 answer

Plugins in WPF MvvM with MEF 2

I have tried the following very good tutorial https://www.eidias.com/blog/2013/7/26/plugins-in-wpf-mvvm-with-mef#cm-249 to migrate to MEF2 but for some reason the assemblies are not shown in the catalog. From MEF2 I wanted to use the API…
2
votes
2 answers

Compose exported value with MEF 2

With MEF 1 it was possible to compose an existing object to the container with the ComposeExportedValue(...)-Method (container.ComposeExportedValue...). How can this be done with Microsoft.Composition (MEF 2)? I can't find any Method for this…
user31705
  • 31
  • 2
2
votes
1 answer

Microsoft.Composition (MEF2) Conventions and Open Generics

I have a type public class Queue : IQueue { .... } I can export this using [Export(typeof(Queue<>))] which will enable me to import with [Import] Queue [Import] Queue However, I would like to import these types…
bornfromanegg
  • 2,826
  • 5
  • 24
  • 40
1
2