This project has moved and is read-only. For the latest updates, please go here.

Import parts from assembly targeting .NET 3.5 into host targeting .NET 4

Aug 9, 2010 at 7:04 PM
Edited Aug 9, 2010 at 7:05 PM

I posted this question on Stack Overflow and got a response that does work in a proof of concept application. However, it isn't the most elegant of solutions and it is easily broken. I was wondering if anyone here had any insight.

Josh Einstein wrote:

I am developing a host application using Managed Extensibility Framework and it's built against .NET 4 and the System.ComponentModel.Composition assembly that is built into the framework. I would like to support the ability to develop parts using .NET 3.5 and export them declaratively.

Since the export attributes are new in .NET 4 and thus cannot be referenced by the .NET 3.5 assembly, I'm not sure the best way to go about exporting parts. Is there an easy way to do this without implementing a new type of catalog that uses some other mechanism for discovering exports?"