title: MEF and Object Disposal
body: <p>When I create an object and it gets added to the container and then I'm done with it how can I ensure it's disposed of correctly? </p>
  
  <p>Reading <a href="http://msdn.microsoft.com/en-us/library/ee155691(v=vs.110).aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/ee155691(v=vs.110).aspx</a> says </p>
  
  <blockquote>
    <p>For long-lived composition containers, memory consumption by parts
    with a creation policy of non-shared can become a problem. These
    non-shared parts can be created multiple times and will not be
    disposed until the container itself is disposed. To deal with this,
    the container provides the <strong>ReleaseExport method</strong>. Calling this method
    on a non-shared export removes that export from the composition
    container and disposes it. Parts that are used only by the removed
    export, and so on down the tree, are also removed and disposed. In
    this way, resources can be reclaimed without disposing the composition
    container itself.</p>
  </blockquote>
  
  <p>So for example if I use something like <code>Caliburn.micro</code> with MEF and I create a new <code>ViewModel</code>, when the <code>ViewModel</code> is closing if I add a <code>ReleaseExport</code> call on the container does this clean up the reference so it's no longer taking up memory? (Is this the <em>right</em> way to do this?)</p>
  
  <p>Also does calling <code>ReleaseExport</code> stop me from creating another object of that type in the future, or does the catalog still contain the item and I can re-create it whenever I wish?</p>