Loading external modules

Topics: Prism v4 - Silverlight 4
May 10, 2011 at 5:33 PM

I need to load my modules from the remote location in the same domain. The module URL is, for example, http://mysite/modules/modulea.xap.

How do I configure ModuleInfo element in ModuleCatalog in order to achieve that?


May 10, 2011 at 6:18 PM


According to the ModuleInfo´s Ref´s property summary in ModuleInfo class:

Reference to the location of the module assembly. The following are examples of valid ModuleInfo.Ref values:

·         http://myDomain/ClientBin/MyModules.xap for remote module in Silverlight

·         file://c:/MyProject/Modules/MyModule.dll for a loose DLL in WPF.”

This means, in your ModuleCatalog.xaml file, you could try setting the Ref property like this:

<Modularity:ModuleInfo Ref="http://mysite/modules/modulea.xap" ModuleName="ModuleA" 
ModuleType=" ModuleA. ModuleA, ModuleA, Version=, Culture=neutral, PublicKeyToken=null" />


I hope you find this information useful.


Miguel Bronzovic



May 17, 2011 at 8:57 PM

Thanks Miguel. How about InitializationMode attributes? ... And PublicketToken is null?

May 18, 2011 at 2:58 PM


If you are using MEF as your Dependency Injection Container, you could decorate your modules classes with the InitializationMode attribute. You don’t need to specify PublicKeyToken of your assembly.

You can read more about modularity in Chapter 4: Modular Application Development, Specifying On-Demand Loading Using MEF section where this topic is covered.


Miguel Bronzovic