title: How to determine the type of a MEF plugin class?
body: <p>I'm using <a href="http://www.google.se/url?sa=t&amp;rct=j&amp;q=mef%20msdn&amp;source=web&amp;cd=1&amp;ved=0CDsQFjAA&amp;url=http://msdn.microsoft.com/en-us/library/dd460648.aspx&amp;ei=lduPT46VAsyN4gSu_qm7BA&amp;usg=AFQjCNE_UJdqKA8b6AnLTtwDpa7nJC2hLQ" rel="nofollow">MEF</a> (C# 4.0) for my plugin system. At times it is necessary to get a list of the derived types of all plugins (mainly for XML deserialization). Can this be done without instantiating the plugin?</p>
  
  <p>This works but requires instantiation:</p>
  
  <pre><code>var cat = new DirectoryCatalog(path, "*.dll");
  var container = new CompositionContainer(cat);
  container.ComposeParts(this);
  foreach (var plugin in Plugins)
  {
      // Would be better if this could be done via Metadata!
      DoStuff(plugin.Value.GetType());
  }
  // ...
  [ImportMany]
  public Lazy&lt;PluginBase, IPluginMetadata&gt;[] Plugins
  {
      get;
      private set;
  }
  </code></pre>
  
  <p><strong>Q:</strong> Is it possible to accomplish this via some <code>ExportAttribute</code>, or some other technique?</p>
  
  <p>Thanks.</p>