Application Library caching & PRISM

Topics: Prism v4 - Silverlight 4
Aug 9, 2011 at 7:57 AM

Hello everyone,

 

I have been trying to leverage Application Library Caching this time with MEF and get an interesting problem.

I have followed the documentation:

The second approach 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.

Steps:

1) I have strong named the open source CoverFlow control with a key.

2) I have created a mapext.xml file for the assembly and placed it next to it.

3) I have activated the "Application Library caching" checkbox in the projects.

4) rebuilt.

I can confirm that the open source cover flow control now shows up in a zip file next to the xap file. The xap file doesn't include the cover flow control anymore.

So what happens at this stage? Should I be able to run the application or do i still need to add some more meta data somewhere? I can't see that from the documentation.

If thats all, this doesn't work.  I get an exception that the coverflow control or one of it's dependencies can't be loaded.

I have a sample project uploaded here to illustrate the problem:  Download

Your help on this would be highly appreciated,

Kind Regards,

Houman

Aug 9, 2011 at 10:45 PM
Edited Aug 9, 2011 at 10:48 PM

Apologies, it seems I had forgotten adding the Prism libraries to the project, hence it wasn't buildable.  If this has put somebody off to try it. Please don't give up on me and try again. :)

Here is the new download.

 

Thank you

Developer
Aug 10, 2011 at 2:03 PM

Hi Houman,

We've tested your sample and were able to verify the problem you're experiencing; we also found out that adding a reference to the DC.ControlLibrary in the shell project fixes the problem; usually, when you have a custom control in a module, you need to add a reference to the library containing that control in your shell as well.

I hope you find this helpful.

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

Aug 10, 2011 at 3:19 PM

Hi Guido,

Oh my goodness. That was all about it? I can't believe I didn't see that.  But its really hard to figure this out. How did you guys see that? Amazing!!!!!

I don't want to be dramatic again, but you don't know how much your help means to me. I was working on this since last Friday non-stop.   THANK YOUUUUUUUUUUUUU!

Finally the assemblies are strong named and are using Application library caching.

Have a great day!!!
Houman