6
Vote

SL3 caching not working with Modules

description

hi,
 
I am using silverlight 3 library caching feature. It doesnt work when I try to load modules. Prism doesnt download the libraries configured as external parts.
Is it a know bug?
 
Regards,
Rams

file attachments

comments

diegopoza wrote Feb 11, 2011 at 2:28 PM

Hi Rams,
As explained in the Deployment chapter (http://msdn.microsoft.com/en-us/library/gg430856%28PandP.40%29.aspx) of the Prism v4 MSDN documentation, you need to have the necessary metadata in your modules in order to leverage Silverlight Application Library Caching.
From the documentation: “The second approach (on how to reduce XAP file size) is to leverage application library caching in Silverlight. To use this feature, you go to the Silverlight project properties of a project and select the check box labeled Reduce XAP size by using application library caching. When you do this, any referenced assemblies that have the right metadata files collocated with them will not be included in the XAP file; instead, they will be placed in a separate .zip file, and the .zip file will be referenced by the XAP file's ApplicationManifest.xaml file as an external part. The signed Silverlight Prism Library binaries have the required metadata files to use this feature as well as the libraries from the Silverlight SDK and the Silverlight Toolkit. To leverage this functionality for your own shared assemblies, you need to provide a metadata file, as described in the topic, "How to: Use Application Library Caching" on MSDN (http://msdn.microsoft.com/en-us/library/dd833069%28VS.95%29.aspx).”

tugbayatilla wrote Mar 30, 2011 at 5:06 PM

Hi,
I have similar problem.
I'm using Prizm 4 MVVM model, and loading my modules with catalog.xaml.
I want to reduce the xap file size with application library caching,

This is the list i did,
  1. create assembly.extmap.xml file for my custom assembly
  2. select the check box for my silverlight applications Reduce XAP size by using application library caching
  3. build my project and everything is done as expected.
  4. All required assemblies seperated as different zip files. as well as my custom assembly
  5. the problem starts here. When module initialize, It is expecting my custom assembly, but it is waiting seperate zip file in ClientBin folder.
What must I do?

MartinRandall wrote Oct 25, 2011 at 2:42 PM

This does not answer the question.

I have a module XAP that is using the System.Xml.Linq assembly, which has been correctly compressed to it's own seperate .zip file in the ClientBin folder. The module's manifest has the Deployment.ExternalParts set-up indicating that it needs this assembly. When I load this module into my main assembly using Prism, it fails to load the assemblies listed in the Deploymet.ExternalParts.

This is definitely a bug!

Martin

GuidoMaliandi wrote Nov 16, 2011 at 11:19 AM

Hi,

You might find the explanations in the following discussion (http://compositewpf.codeplex.com/discussions/279315) useful. In this thread we examined the way Prism loads assemblies from Xap files in memory, and found that the external parts are ignored. We provided a possible workaround in that thread, which you might find useful for your problem.

I hope you find this helpful.

Guido Leandro Maliandi
http://blogs.southworks.net/gmaliandi

GuidoMaliandi wrote Jan 20, 2012 at 7:24 PM

Hi,

You might find the following blog post useful, as it provides an explanation and a possible workaround for this in both Unity and MEF:
http://blogs.southworks.net/gmaliandi/2012/01/how-to-use-application-library-caching-in-prism-modules/

Thanks,

Guido Leandro Maliandi
http://blogs.southworks.net/gmaliandi