Does PartCreator and CompositionHost is silverlight only feature?

Oct 6, 2009 at 6:21 PM

I saw Glen talk about MEF 7 at 10-4

Glen spoke about some classes that simplify the interaction with the composition container,

I wasn’t able find it on the MEF 7 bits, so does it a Silverlight only feature?

I use to implement those concept when i used MEF version prior to 7 and I really not hard to implement,
but it is a very common need (I was doing it on any project that I using MEF in) so I think it will be better to add it to the MEF library API.


Oct 6, 2009 at 7:17 PM

Silverlight only at this point, we are planning though to ship an OOB version for the desktop on codeplex, and it will roll into a future version of the framework.

A working prototype of what this might look like is here. The project contains a desktop implementation of PartInitializer along with a sample app using it.




Oct 7, 2009 at 6:29 AM


I was looking at the CompositionHost API and I have some suggestions:

Because you don’t expose the container I think you should expose the support for GetExportedValues (many scenario use it instead of using the Import attribute).

I suggest adding the following APIs:

public static IEnumerable<T> GetValues<T> ()


var plugins = _container.GetExportedValues<T> ();

       return plugins;



public static T GetValueOrDefault<T> ()


var plugin = _container.GetExportedValueOrDefault<T> ();

return plugin;