title: How to use MEF Inherited Export & MetaData?
body: <p>I have an interface: </p>
  
  <pre><code>[InheritedExport(typeof(IMetric))]
  public interface IMetric { ... }
  </code></pre>
  
  <p>I have a Meta attribute interface:</p>
  
  <pre><code> public interface IMetricAttribute { ... }
  </code></pre>
  
  <p>and an attribute that implements it:   </p>
  
  <pre><code>[MetadataAttribute]
  [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
  public class MetricAttribute : ExportAttribute, IMetricAttribute {
      public string MetricName { get; set; }
      public string MetricDescription { get; set; }
  
      public MetricAttribute(string name, string description)
          : base(typeof(MetricAttribute)) {
          this.MetricName = name;
          this.MetricDescription = description;
      }
  }
  </code></pre>
  
  <p>I then have two classes: </p>
  
  <pre><code>[Metric("MetricA","MetricA")]
  public class MetricA: IMetric { ... }
  
  [Export(typeof(IMetric))] &lt;&lt;&lt;&lt; THIS IS IMPORTANT
  [Metric("MetricB", "MetricB")]
  public class MetricB: IMetric { ... }
  </code></pre>
  
  <p>I then try to import the metrics ( i can see both in the cataloge)</p>
  
  <p>The following returns be MetricA AND MetricB</p>
  
  <pre><code>var metrics = compositionContainer.GetExports&lt;IMetric&gt;();
  </code></pre>
  
  <p>However the following returns ONLY MetricB and NOT MetricA </p>
  
  <pre><code>var metrics = compositionContainer.GetExports&lt;IMetric, IMetricAttribute&gt;();
  </code></pre>
  
  <p><strong>any idea why?</strong> </p>
  
  <p>(note the duplicate export on MetricB (it already has it from implementing IMetric))</p>
  
  <p>thanks</p>
  
  <p>David</p>