Suppose I define an export in AssemblyA:
[Export(typeof(Foo))]
public class Foo
{
...
}
Is there a way to determine the export of Foo is from AssemblyA in the CompositionContainer?
What I am trying to do, is for any given assembly that provides MEF exports, it must also include one MEF export of a specific interface. And I want to be able to flag any assemblies that do not satisfy this rule.
There’s no way to do this from in a CompositionContainer. I would suggest creating an AssemblyCatalog for each assembly and checking whether any of its Parts have an ExportDefinition matching the interface you want.