Oct 17, 2011 at 4:51 PM
Edited Oct 17, 2011 at 5:54 PM
I am developing a modular silverlight application with MEF. Up to this point my module catalog had specified each module to load automatically (WhenAvailable). I then changed the modules to load OnDemand and used the ModuleManager to manually load the modules.
I am getting the following error:
Unable to locate the module with type 'MyCompany.MyProject.Module1.Module1Module, MyCompany.MyProject.Module1, Version=184.108.40.206, Culture=neutral, PublicKeyToken=null' among the exported modules. Make sure the module name in the module catalog matches
that specified on ModuleExportAttribute for the module type.
I get this error for each module I attempt to manually load. However, the modules are loading fine because I can still navigate to the views within the module XAP.
My module classes are declared in a regular way:
public class Module1Module : IModule
I also tried specifying InitializationMode.OnDemand in the ModuleExportAttribute.
The MefModuleManager.OnModuleLoaded event is not raised even though the modules are being loaded.
It seems like MEF may be failing on some other import and not the module class itself, but I don't see how. None of my modules register any services. Right now they all contain
only views and viewmodels.
Again, everything seems to work fine loading them OnDemand except I get the error.