Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Dynamic module loading in Prism (CAL)

0.00/5 (No votes)
4 Jun 2010 2  
Dynamic module loading in Prism (CAL)
While using Microsoft Prism with a Silverlight application, we need not download all modules at the client together. This can be done on demand (as the client navigates to that particular module via the application).

The first two steps are described well in the Prism documentation available on msdn. I have just mentioned them for completeness here.

1) Set the copy local for assemblies that are included in other project to false.

2) Create a ModulesCatalog using a xaml file or use code behind.

3) A third step (undocumented) that I figured out after spending some time debugging Prism code (when steps 1 and 2 were not working for me) was to make sure that the Generate Silverlight manifest file checkbox is checked in the project’s properties. By project, I mean the project that is going to be loaded dynamically at runtime. Also, do not change the name of the Manifest file template. Let it continue to be called AppManifest.xml.

For those interested, code with the reference to the AppManifest.xml file can be found in the XapModuleTypeLoader class (in the Prism source code). If this value is not set, the Prism code steps out before loading the module.

Cheers

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here