How to add ModuleInfo to ModuleCatalog and load Module dynamically?

Topics: Prism v4 - Silverlight 4
Jan 5, 2011 at 8:32 AM

Hi, I'm getting started Prism4 with MEF extension to build a composite application.
I'm thinking an application that provides dynamic module loading without restart the application.

For example, there are projects; Main, ModuleA, ModuleB, ModuleExtra.
ModuleA and ModuleB are kind of 'built-in' modules so it can be described by ModuleCatalog at the design time.
However, ModuleExtra can be a replacement. So the application can't aware its ModuleInfo at the design time.
Additionally, The application should load a ModuleExtra at the runtime without restart the application. 

How can I solve this? Any suggestion or advice will be great.


Jan 5, 2011 at 2:41 PM


As explained in the modularity chapter of the Prism MSDN documentation, you can load modules on demand. You could check the "Loading Modules on Demand" section of the aforementioned chapter, where this is explained.

Note that you can also download the module in the background, to improve your application's startup time.

I hope you find this helpful.

Guido Leandro Maliandi

Jan 5, 2011 at 4:51 PM

You could use DeploymentCatalog to download that extra module, if you dont need to add it to the modulecatalog.