This project has moved. For the latest updates, please go here.

Mefx.exe cannot load requested types

Dec 1, 2010 at 11:21 PM

Mefx.exe is giving this error:

Error: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.

Any idea why?

The problem I'm trying to solve is that I'm having composition failures but I don't know why; no exception is being thrown.  I had it working at one time, but now it's just stopped.  I'm loading a module at runtime like this:

var dc = new DeploymentCatalog("MRAOrg.Module.xap");
dc.DownloadCompleted += new EventHandler<System.ComponentModel.AsyncCompletedEventArgs>(dc_DownloadCompleted);

Then, when the download completes, I do:

var container = new CompositionContainer(dc);

Ihave a property like so:

[ImportMany(AllowRecomposition = true)]
public Lazy<ModuleContracts.IModuleMainViewIDictionary<stringobject>>[] ModuleMainViews

The value of the property gets set to any empty collection, so it's not finding anything, though I know there is one in the xap I just loaded:

public partial class OrgModuleMainView : UserControlModuleContracts.IModuleMainView