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

The structural type system

Dec 2, 2008 at 12:54 PM
I'm wondering on how to make use of the structrual type system. The way I've understood it is that MEF doesn't rely typing to
resikve contracts but rather the structure of them. If you, for example, have a look at the INavigationService.cs file in the
XFileExplorer sample you find the following comment

// MEF uses structural matching which allows component authors to use shared contract
// without having to share binaries

In the Preview 2 bit the two class libraries XFileExplorerComponents and XFileExplorerFavorites used a modified project file
to link these from the main project but in Preview 3 these have been changed to project references. Going back to the comment
above, does this mean that I could tell someone "You need an interface that looks like this" and they can create the interface
definition inside of their project and MEF will be able to hook that up with mine?

I would assume my above statment is false because you won't be able to perform a cast between the two interfaces, so how
exactly do you share contracts without sharing binaries?

Dec 2, 2008 at 8:46 PM
You don't. Structural values have been removed from MEF - the comments in the sample appear to be stale.
Dec 3, 2008 at 2:31 PM
Edited Dec 3, 2008 at 2:31 PM
That sure explains it, thanks! ;)
Also, one of the samples (Preview 3) has an old reference to the StructuralValues.dll