title: How to add instance of the class which satisfies import to CompositionContainer
body: <p>I am facing the following problem:</p>
  
  <pre><code>var catalog = new AggregateCatalog();
  catalog.Catalogs.Add(new AssemblyCatalog(typeof(Type1).Assembly));
  catalog.Catalogs.Add(new AssemblyCatalog(typeof(Type2).Assembly));
  
  using (CompositionContainer container = new CompositionContainer(catalog))
  {
  }
  </code></pre>
  
  <p>I need one more export:</p>
  
  <pre><code>Export[(typeof(Type3))]
  </code></pre>
  
  <p>The thing is that I can't include an assembly with the class which has this Export attribute. I want to tell the container that:</p>
  
  <pre><code>var myObject = new Type4();
  </code></pre>
  
  <p>myObject (the instance of Type4) should be exported each time the Import[(typeof(Type3))] is needed. Besides I can't mark Type4 with Export[(typeof(Type3))] and also I want the instance of the class to be used by MEF (so marking this class with Export attribute doesn't work, because I am changing myObject before I pass it to MEF and I want it to be used to satisfy Import).</p>
  
  <p>Then when I try to do:</p>
  
  <pre><code>container.SatisfyImportsOnce(importer);
  </code></pre>
  
  <p>I expect that MEF will get all the objects from the assemblies in catalog, and for the missing Type3 it will use myObject. This should be the value when I do:</p>
  
  <pre><code>container.GetExportedValue&lt;Type3&gt;();
  </code></pre>
  
  <p>I spent one day trying different approaches: custom ExporterProvider and some sort of inheritance from Type4 to mark it with proper Export attribute but I can't get it working as I want.</p>
  
  <p>I would be very grateful for help.</p>
  
  <p>Thank you!</p>