I have 2 assemblies:
Assembly 1:
interface IWeapon { int Might { get; } } [Export("sword")] public class Sword : IWeapon { public int Might { get { return 10; } } }
Assembly 2:
interface IWeapon { int Might { get; } } var catalog = new AssemblyCatalog(typeof(Ninja.Sword).Assembly); var container = new CompositionContainer(catalog);
I know how to make this work. I can either ask the MEF (Managed Extensibility Framework) for the object, or get it to export the correct IWeapon instead of the name of the object by name.
Can MEF do a duck for me and return a proxy object if all interface points are implemented?
Sam saffron
source share