I’m exporting some classes implementing the IFoo interface like this
public interface IFoo { }
[Export("A", typeof(IFoo))]
public class Foo1 : IFoo { }
[Export("B", typeof(IFoo))]
public class Foo2 : IFoo { }
When I try to import one of them using
containter.GetExportedValue<IFoo>("A");
it works well but when I try to import all of them like this
[ImportMany]
IFoo[] foos;
it doesn’t work.
Can someone tell me how to solve this?
To have it both ways, declare 2 exports:
Then it should work (i did a test sample and got it to work).
HTH,
Bab.