Dropping a dll containing one export and refreshing catalog results in 2 exports
description
Hello,
I have a shared dll containing an interface and another dll that implements it as follows :
public interface IPricer
{
void Send(string type, string data);
}
[Export(typeof(IPricer))]
[ExportMetadata("InstrumentType", "EQUITY")]
public class Pricer : IPricer
{
public void Send(string type, string data)
{
System.Console.WriteLine(string.Format(CultureInfo.CurrentCulture, "Type={0} Data={1}", type, data));
}
}
After dropping the implementation dll into my plugin folder and doing a DirectoryCatalog.Refresh(), I iterate through the ExportsChangeEventArgs.AddedExports (supplied by the ExportsChanged event handler) and find two exports instead of one with the following contract names :
[NamespaceGoesHere]IPricer
System.ComponentModel.Composition.Contracts.ExportFactory
The first export, IPricer, is what I expect; the second export is killing me; what is this thing and where did it come from? The implementation dll contains nothing but the Pricer code I posted above and my plugin folder contains nothing but that one dll. Is this a bug or am I missing something?
Many thanks,
Anthony