D'oh. I knew there was a simple solution. Thanks!
On Saturday, September 10, 2011, David Kean <[email protected]> wrote: > In Foo.dll, derive from Bar and add an export: > > > > [Export(typeof(IBar))] > > public class ExportableBar : Bar > { > } > > > > From: [email protected] [mailto:[email protected]] On Behalf Of Matt Siebert > Sent: Thursday, September 08, 2011 11:33 PM > To: ozDotNet > Subject: Manually registering an export from a MEF plugin > > > > Hey folks, > > > > I'm beginning to use MEF in a solution that involves a mix of .NET 3.5 and 4.0 projects. I'm using MEF in the 4.0 projects and I need to register some exports that live in the 3.5 projects. The problem is I need to do this from one of the plugin projects. > > > > To illustrate this, imagine a console application such as... > > > > class Program > > { > > static void Main(string[] args) > > { > > var program = new Program(); > > > > var catalog = new DirectoryCatalog("."); > > using (var container = new CompositionContainer(catalog)) > > { > > var batch = new CompositionBatch(); > > batch.AddPart(program); > > container.Compose(batch); > > > > program.Test(); > > } > > } > > > > [
