Packaging Libraries to Download Once

Topics: Prism v2 - Silverlight 4
Jun 27, 2010 at 4:35 PM

I have an application with about 10 modules including a shell module that controls all the rest. The shell module comes down first and loads the others on demand.

The trouble here is that I have Unity, Prizm and MEF libraries in ALL the XAP files for each module. This creates an empty module of about 340K in size.

I want to only include the libraries for MEF, Unity and Prizm in the first module (shell) to download to the client then have the others use those libraries instead of downloading all the libraries for every module. This seems like a common thing we would need to do. Is there an article or documentation on how to do this somewhere? If I remove the libraries by hand from the XAP files the application hangs because it can't find the required libraries.

Jul 2, 2010 at 7:20 PM


In order to avoid the references of your modules to be copied to their local project paths, you must set their copy local property to false. You can read about this in this article from the Prism documentation. Another possibility would be to use Silverlight’s Application Library Caching. You can read about it in this blog post by Tim Heuer.

As an additional note, please take into account that with Prism 4, it is suggested to use MEF or Unity, but not the two at the same time. You can read more about this in this blog post.

I hope you find this helpful.

Guido Leandro Maliandi