Reducing XAP Size by using application library caching

Thread is closed for posting
7 posts, 0 answers
  1. eraashishgupta
    eraashishgupta avatar
    19 posts
    Member since:
    Nov 2008

    Posted 16 Feb 2011 Link to this post

    Hi all,
    I have one question i was trying to use the feature of silverlight whihc is reduce xap file size by using application library caching, 
    i have two systems one one i had telerik installed and on another i didnt had telerik installed.
    When i build the solution on the system having telerik installed everything worked like charm , but when i build up on the system which dont have telerik installed the xap size grew very large as it inlcluded all the telerik dlls inside it.

    So ideally this should not happen i then tried everything zipping down individual dlls and altering the appManifest.xaml file and adding external part but nothing works.

    So is how to use application library caching on a system where we dont have telerik installed.
    Same rule applies for any other third party assembly.

    One solution which is obvious and comes to mind is install the third party assembly files in the global assembly cache that too i tried but its of no help

    Can you sugggest me any solution to this problem.

    Thanks,
    Aashish Gupta
    www.smallworkarounds.net
  2. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 21 Feb 2011 Link to this post

    Hello eraashishgupta,

    In order to take advantage of the application library chaching, you need to add the assemblies accompanied by a valid assemblyShortName.extmap.xml mapping files.Those files configure the assemblies for use with application library caching. You can read more here.

    If you open the binaries from your installation folder, you will notice that each dll file is accompanied by a mapping file and therefore you can reduce the size of your XAP. However, when you try to build your application on a machine where you only copy the dll files, the assemblies cannot be properly configured and you cannot use the application library caching.

    Can you please copy the .extmap.xml files along with the dll files to the machine with no Telerik installation and build your solution and let us know if the size of the XAP is properly reduced?

    Also, you can have a look at this blog post that might also help.

    Regards,
    Tina Stancheva
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  3. DevCraft banner
  4. Muneswar Rao Gali
    Muneswar Rao Gali avatar
    1 posts
    Member since:
    Feb 2010

    Posted 24 Apr 2012 Link to this post

    How can I redirect my silverlight application to load newer version of telerik dlls without building my code? Basically my requirement is below:
    My silverlight app is referring 3rd party silverlight dll of V1.0.0.0 and I want my app to load this 3rd party dll dynamically. I can do this as you explained in this article. Is it possible to load V2.0.0.0 of 3rd party dll without rebuilding my app. If yes, can you please route me to a proper link that explains how?
  5. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 26 Apr 2012 Link to this post

    Hello Muneswar,

    We believe that in your case it would be better to take advantage of the Managed Extensibility Framework introduced in the .NET Framework 4. MEF is a library for creating lightweight, extensible applications. It allows application developers to discover and use extensions with no configuration required. It also lets extension developers easily encapsulate code and avoid fragile hard dependencies. MEF not only allows extensions to be reused within applications, but across applications as well.

    You can find more info about it here.

    Greetings,
    Tina Stancheva
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  6. Marcel
    Marcel avatar
    25 posts
    Member since:
    Jan 2011

    Posted 13 Aug 2013 Link to this post


    • I have a silverlight control which uses Telerik controls, hosted in a custom silverlight web part in SharePoint 2010. It works well until I try to reduce the XAP file size. Then the silverlight control does not appear in the web part.


      I followed the instructions at: http://msdn.microsoft.com/en-us/library/dd833069(v=vs.95).aspx steps 1-4 of 'To enable application library caching'. I did not perform the additional steps in 'To configure an assembly for use with application library caching' since I believe this is already done for my Telerik dlls.


      I am not sure what I am doing wrong. I see the new *.zip files in the bin folder of the silverlight app and I see the xap file has been reduced in size, but the Silverlight control does not appear in the SharePoint web part.


      I even tried copying the *.extmap.xml files from the telerik install location to the bin directory of my silverlight project and of my SharePoint project. This made no difference.


      Running in the VS debugger does not trap any error and the breakpoints do not set in silverlight (no symbols have been loaded for this document), even after a full rebuild. (This normally works with the option 'Reduce XAP size ..' unchecked). Where can I find the error? My silverlight unhandled exception handler is not being invoked and I suspect that the silverlight control is not even loading.


      What am I missing?  Thank you for any help.



  7. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 16 Aug 2013 Link to this post

    Hello Marcel,

    I'm not sure what might be going wrong in your application exactly. However when you build a Silverlight solution with enabled assembly caching, the build packages the assemblies into separate zip files and generates an ExtensionPart element in the application manifest. So can you please make sure that all required zip files are saved along with the XAP of the application in the same location?

    If you place the XAP file in a SharePoint library, please add all zip files created by the assembly caching in the same location so that your project can find and download them properly.

    Another thing you can check is whether you're using the NoXaml Telerik assemblies. These assemblies do not contain any xaml and therefore they don't provide any built-in ControlTemplates for the Telerik controls. And that might be the reason why you can't see anything in the WebPart.

    I hope this information can help you locate the cause for the issue.

    Regards,
    Tina Stancheva
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  8. Marcel
    Marcel avatar
    25 posts
    Member since:
    Jan 2011

    Posted 16 Aug 2013 Link to this post

    Hi Tina,

    Thank you for your reply it helped me resolve the issue. I have posted the solution here .
Back to Top
DevCraft banner