[MEF Bootstrapper] Satisfy imports breaks import of IShell

Topics: Bootstrappers & IoC, Getting Started
Jul 19, 2011 at 9:28 PM


Im creating an WPF app that is using MEF.
I have some Export and Import attributes specfied and I'm trying to add some components to the CompositionBatch.

var memberRepository = new MemberRepository();

var teamRepository = new TeamRepository();

As you can see im calling the SatisfyImportsOnce method for the added components;

But if I add this piece of code, the IShell import could not be located by the GetInstance method.

So I'm probably doing something wrong here because when I remove the SatisfyImportsOnce method, the Import of IShell can be satisfied.... :x

What am I missing here? Or do I need to add my components in a different way or should I satisfy my imports on a different level?

Jul 30, 2011 at 12:33 AM

I can't see the problem right now, but it's likely to be related to MEF.
Does the Shell have some dependencies to be satisfied, too?