How to make a plugin enabled software?

Apr 24, 2010 at 10:16 AM

Hi!

New to MEF and I have some trouble understanding how to make a plugin enabled software.

I keep getting this error "More than one export was found that matches the constraint"

I want to get all exports that is from a specific interface and use them in a collection like fashion but as soon as I get more than one exports I get this error message.

So you out there who knows MEF, what do I have to do to be able to import more than one export of the same type?

 

/port513

Developer
Apr 25, 2010 at 5:43 AM

Are you using ImportMany?

[ImportMany]
public IEnumerable<IPlugin> Plugins { get; set }