title: Getting Error in No valid exports were found that match the constraint
body: <p>While running the following Program i am getting the </p>
  
  <p>The composition remains unchanged. The changes were rejected because of the following error(s): The composition produced a single composition error. The root cause is provided below. Review the CompositionException.Errors property for more detailed information.</p>
  
  <p>1) No valid exports were found that match the constraint '((exportDefinition.ContractName == "System.Collections.Generic.IEnumerable(MEF.IToolWindow)") AndAlso (exportDefinition.Metadata.ContainsKey("ExportTypeIdentity") AndAlso "System.Collections.Generic.IEnumerable(MEF.IToolWindow)".Equals(exportDefinition.Metadata.get_Item("ExportTypeIdentity"))))', invalid exports may have been rejected.</p>
  
  <p>Resulting in: Cannot set import 'MEF.Program+Application.ToolWindows (ContractName="System.Collections.Generic.IEnumerable(MEF.IToolWindow)")' on part 'MEF.Program+Application'.
  Element: MEF.Program+Application.ToolWindows (ContractName="System.Collections.Generic.IEnumerable(MEF.IToolWindow)") -->  MEF.Program+Application</p>
  
  <p>Code is here</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.ComponentModel.Composition;
  using System.ComponentModel.Composition.Primitives;
  using System.ComponentModel.Composition.Hosting;
  using System.Collections;
  
  //Without MEF
  namespace MEF
  {
      public interface IToolWindow
      {
          string Name { get; set; }
      }
      public interface IMenuService
      {
          IMenu GetMenu(string menuName);
      }
  
      public interface IMenuItem
      {
          string Name { get; set; }
          string Title { get; set; }
          Action Handler { get; set; }
      }
  
      public interface IMenu
      {
          string Name { get; set; }
          string Title { get; set; }
          string ToolWindow { get; set; }
          IEnumerable&lt;IMenuItem&gt; Items { get; set; }
          IMenuItem GetItem(string itemName);
      }
  
      //public interface IMenuItem&lt;&gt; :IMenuItem{}
  class Program
  {
      static void Main(string[] args)
      {
          var container = new CompositionContainer();
          var compositionBatch = new CompositionBatch();
  
          var someToolWindow = new SomeToolWindow();
          var application = new Application();
          var menuService = new MenuService();
  
          compositionBatch.AddPart(application);
          compositionBatch.AddPart(someToolWindow);
          compositionBatch.AddPart(menuService);
  
  
          container.Compose(compositionBatch);
  
          //application.ToolWindows = new List&lt;IToolWindow&gt;{someToolWindow};
          //someToolWindow.MenuService = menuService;
  
  
          foreach(var window in application.ToolWindows)
              Console.WriteLine(window.Name);
          Console.WriteLine(someToolWindow.MenuService);
          Console.ReadLine();
      }
  
  
  
      public class Application
      {
          [Import]
          public IEnumerable&lt;IToolWindow&gt; ToolWindows{get;set;}
  
          public IToolWindow GetWindow(string windowName)
          {
              return ToolWindows.Where(w =&gt;w.Name == windowName).FirstOrDefault();
          }
      }
  
      [Export(typeof(IToolWindow))]
      public class SomeToolWindow : IToolWindow
      {
          [Import]
          public IMenuService MenuService { get; set; }
          public string Name { get; set; }
          public string Title { get; set; }
  
      }
  
      [Export(typeof(IMenuService))]
      public class MenuService:IMenuService
      {
          public IEnumerable&lt;IMenu&gt; Menus {get;set;}
          public IMenu  GetMenu(string menuName)
          {
              return Menus.Where(m =&gt; m.Name == menuName).FirstOrDefault();
          }
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Any one have a idea?</p>