title: MEF : How can I import a class which has a constructor marked with the ImportingConstructorFlag
body: <p>My question title sounds a little bit difficult - sorry. I'm new in MEF :-).</p>
  
  <p>My scenario:</p>
  
  <pre><code>public class MainClass
  {
    [ImportMany(typeof(ITest))]
    private List&lt;ITest&gt; Tests { get; set; }
  
    public MainClass()
    {
      Init();
    }
  
    private void Init()
    {
       DirectoryCatalog catalog = new DirectoryCatalog(@"./");
       CompositionContainer container = new CompositionContainer(catalog);
       container.ComposeParts(this);
    }
  }
  
  
  
  [Export("BirthdayJob")]
  [Export(typeof(ITest))]
  public partial class BirthdayTest : ITest
  {
    [ImportingConstructor]
    public BirthdayUserControl(IParameter parameter)
    {
       InitializeComponent();
       this.Parameter = jobParameter;
    }
  
     public IParameter Parameter { get; set; }
  }
  
  [Export(typeof(IParameter))]
  [Export("BirthdayParameter")]
  public class BirthdayJobParameter : IParameter
  {
     public override string ToString()
     {
         return "Birthday Remember";
     }
  }
  
  
  public interface IParameter : IMefInterface
  {
  
  }
  
  public interface IMefInterface
  {
  
  }
  </code></pre>
  
  <p>In the generic list of test, I should have all possible ITest objects with the associated IParameter object. Unfortunately, there aren't any items in the generic list.</p>
  
  <p>Can you help? What did I do wrong?</p>
  
  <p>Thanks in advance.</p>
  
  <p>Regards, pro</p>
  
  <p>//Edit</p>
  
  <p>So I have a compilable Class for my problem :</p>
  
  <pre><code>using System;
  using System.ComponentModel.Composition;
  using System.ComponentModel.Composition.Hosting;
  
  namespace ObjectContracts
  {
      public class Program
      {
          static void Main(string[] args)
          {
              var container = new CompositionContainer(new TypeCatalog(typeof (IFoo), typeof (Bar), typeof(Foo)));
              var bar = container.GetExportedValue&lt;Bar&gt;();
              Console.WriteLine(bar.Foo.Message);
              Console.ReadLine();
  
          }
  
      }
  
      [InheritedExport]
      public interface IFoo
      {
          string Message { get; set; }
      }
  
      [Export]
      public class Bar
      {
          [ImportingConstructor]
          public Bar([Import("Foo")]IFoo foo)
          {
              this.Foo = foo;
          }
  
          public IFoo Foo { get; set;}
      }
  
      [Export("Foo")]
      public class Foo : IFoo
      {
          public Foo()
          {
              Message = ":-)";
          }
          public string Message { get; set; }
      }
  }
  </code></pre>
  
  <p>What do I do wrong? Please help me :-)</p>
  
  <p>Regards, patrick</p>