mef

MEF Constructor Parameters with Multiple Constructors

Hi, i starting to use MEF, and i have a class with multiple constructors, like this: [Export(typeof(ifoo))] class foo : ifoo { void foo() { ... } [ImportingConstructor] void foo(object par1) { ... } } i am using catalog.ComposeExportedValue() when composing to suply the par1 value to 2nd constructor: ... catalog.ComposeEx...

ShowDialog on MEF Component Only Works Once

I created a WPF Window and made it a MEF Export. I can do a ShowDialog once on the MEF Import but the second time it aborts because the MEF component was closed by the first ShowDialog. What can be done to allow repeats of ShowDialog? ...

Visual studio 2010 colourizers, intellisense and the rest. Where to start!!

Ok, before I begin I realize that there is a lot of documentation on this subject but I have thus far failed to get even basic colourization working for VS2010. My goal is to simply get to a point where I can open a document and everything is coloured red, from here I can implement the relevant parsing logic. Here's what I have tried/...

Multiple plugin instance loading with MEF

In my last application, using MEF to load plugins went just fine, but now I'm running into a new issue. I have a solution for it that I explain at the end of this question, but I'm looking for other ways to do it. Let's say I have an interface called ApplianceInterface. I also have two plugins that inherit from ApplianceInterface, let...

Mef, passing parameters to a module

Hi guys, I'm studying MEF and I'm not able to resolve a problem. I have a main application, called MainMEF, and a simple module, called SimpleModule. This one consists of a single UserControl which is loaded dinamically. When MainMEF starts up, I would be able to pass to the module a reference to main application contained into MainMEF...

MEF Generic Class With Constructor as Type Contract

I have a generics class, that uses TBase as the type parameter. Using MEF, I wanted a list of Generic Type that it should Import. I tried to use this : 1) [ImportMany(typeof(TBase))] public List<TBase> ObjectList { get; set; } 2) Type IValueType = typeof(TBase) [ImportMany(IValueType)] public List<TBase> ObjectList{ get; set; } 3)...

MEF's CompositionContainer.ComposeParts -- loading whatever can be resolved, and ignoring errors

The biggest problem I'm having so far with MEF is that when I compose parts in my plugin loader wrapper, loading completely bails when it finds an import resolution problem with one of the assemblies. Ideally, I'd like ComposeParts to exhibit some sort of "ignore and continue" behavior, because the ideal user experience would entail loa...

Visual Studio 2010 with Managed Extensiblity Framework

I've been looking into into MEF (Managed Extensibility Framework), but I am not entirely sure if it is something that I need and can help me accommplish what I need to do. Can someone provide an easy to understand description of MEF, provides good resources and tutorials (aside from MSDN), and/or know if it can do the task I am trying t...

MEF and unmanaged code

Is there a way of getting MEF to load unmanaged code, such as com objects that are not written Java or are native Win32 code ? ...

Visual Studio Editor, MEF in-Depth

I have been having difficulty simply writing a Visual Studio Editor Extension with MEF (Managed Extensiblity Framework). I thank those who answered my previous question, as they helped me know that I need to work with MEF. I've been trying to learn MEF for the Visual Studio Editor from MSDN's page, Extending the Editor, but it appears t...

how to parametrize an import in a View?

Hello everybody, I am looking for some help and I hope that some good soul out there will be able to give me a hint :) I am building a new application by using MVVM Light. In this application, when a View is created, it instantiates the corresponding ViewModel by using the MEF import. Here is some code: public partial class ContractE...

Is MEF mature enough to bet the company on ?

My company needs to rewrite a large monolithic program, and I would want it written using a plugin type architecture. Currently the best solution appears to be MEF, but as it is a fairly 'new' thing I am warey of betting the future of my company (and my reputation) on it. Does anyone have a feeling on how mature a solution MEF is ? Th...

How to define the order with ImportMany attribute?

Hi to all, I am just getting into MEF and was wondering how you could define the order of collection exported with [ImportMany]? What I mean here is if I had two classes (Class1, Class2) that implement the interface IService and each of the implementations are in two different libraries (although they could be in the same), I want the ...

Are MEF's ComposableParts contracts instance-based?

I didn't really know how to phrase the title of my questions, so my apologies in advance. I read through parts of the MEF documentation to try to find the answer to my question, but couldn't find it. I'm using ImportMany to allow MEF to create multiple instances of a specific plugin. That plugin Imports several parts, and within calls...

MEF Import Composition Issues

I've read all the questions I can find regarding the issues of composing imports without exporting the containing class but I can't find a solution to my problem. Does anybody know a way to achieve what I'm trying to do? My module assemblies have forms and classes which they use internally. These forms need access to some of the exporte...

Serializing Configurations for a Dependency Injection / Inversion of Control

I've been researching Dependency Injection and Inversion of Control practices lately in an effort to improve the architecture of our application framework and I can't seem to find a good answer to this question. It's very likely that I have my terminology confused, mixed up, or that I'm just naive to the concept right now, so any links ...

MEF part unable to import Autofac autogenerated factory

This is a (to me) pretty weird problem, because it was already running perfectly but went completely south after some unrelated changes. I've got a Repository which imports in its constructor a list of IExtensions via Autofacs MEF integration. One of these extensions contains a backreference to the Repository as Lazy(Of IRepository) (la...

Importing into a Exported object with MEF

I'm sorry if this question has already been asked 100 times, but I'm really struggling to get it to work. Say I have have three projects. Core.dll Has common interfaces Shell.exe Loads all modules in assembly folder. References Core.dll ModuleA.dll Exports Name, Version of module. References Core.dll Shell.exe has a [Export...

IoC - Dynamic Composition of object instances

Is there a way using IoC, MEF [Imports], or another DI solution to compose dependencies on the fly at object creation time instead of during composition time? Here's my current thought. If you have an instance of an object that raises events, but you are not creating the object once and saving it in memory, you have to register the eve...

Should I use MEF or Prism for my Silverlight project?

Hi! My team(3 developers) will be building a Silverlight LOB application. This is the first Silverlight project for us. We've been doing mostly Winforms. We'll be using Silverlight4 / VS2010 / possibly WCF RIA Services, and ASP.NET Web application to handle authentication and host the silverlight pages. We need a way to.. Modularize t...