I am utilizing MEF in my PRISM 4.0 application to load the modules. In order to be sure that they are being downloaded I have made my Shell to import IPartImportsSatisfiedNotification. Then within the OnImportSatirsfied() method, I can clearly see in the debugger that the two modules are found. (See screenshot below)
However I keep getting this error message:
Unable to locate the module with type 'SalesContactManagement.Modules.NavigationModule.NavigationModule, SalesContactManagement.Modules.NavigationModule, Version=1.0.0.0, Culture=neutral, PublicToken=null' among the exported modules. Make sure the module name in the module catalog matches that specified on ModuleExportAttribute for the module type.
Any idea why MEF doesn't work? Any help is highly appreciated.
UPDATE:
Funny enough when I empty the NavigationModule to a minimum it works fine.
[ModuleExport(typeof(NavigationModule))]
public class NavigationModule : IModule
{
private readonly IRegionManager _regionManager;
private readonly ToolbarViewModel _toolbarViewModel;
public void Initialize()
{
}
//[ImportingConstructor]
//public NavigationModule(RegionManager regionManager)
//{
// //_toolbarViewModel = toolbarViewModel;
// _regionManager = regionManager;
//}
}
But as soon as I put an ImportingContructor there, for types that are already registered in Bootstrapper, it fails. Any idea?