Timeout problem with SharePoint Silverlight Web Part 1


SharePoint 2010 includes several Silverlight components that enhance the out of the box functionality the SharePoint platform provides. There are several ways to integrate Silverlight applications with SharePoint pages. You can check MSDN hands-on labs for detailed information about this integration. One of the integration method is using Silverlight Web Parts which comes with SharePoint 2010. The Silverlight Web Part provides deploying custom Silverlight applications to SharePoint pages easily without writing any code.

However if you’re adding a large-sized XAP file to Silverlight web part, web part will probably give the following error.

Could not download the Silverlight application or the Silverlight Plugin did not load.

To re-configure the Web Part or to provide a different Silverlight application (.xap), open the tool pane and then click Configure

If the path of the XAP file is correct, the reason of this error is the Silverlight web part’s 5 sec. default timeout value. So if Silverlight web part couldn’t load the given Silverlight application in 5 sec., it will display that error message.

If you google this error, you will find lots of solution alternatives. In this blog I just wanted to summarize these solutions.

  1. Enabling Application Library Caching:When you use application library caching, Silverlight packages some assemblies as external parts outside the application package (the .xap file). The manifest in the application package specifies the assemblies required at startup and indicates whether they are internal or external to the application package.When a user first visits your Web page, the Silverlight plug-in downloads the application package and all required external parts. These files are added to the browser cache so that they can be reused on subsequent visits. Detailed information about application library caching can be found in “How to: Use Application Library Caching“.
  2. Loading XAP files dynamically: This approach will help to reduce the size of the XAP files. You can check the video: http://www.silverlight.net/archives/videos/loading-dynamic-xaps-and-assemblies. There is also a good XAP preloader solution for loading XAP files dynamically: http://pagebrooks.com/archive/2009/05/17/a-smaller-xap-preloader-for-silverlight.aspx
  3. Change timeout value: Since this timeout value is hard-coded in a JavaScript, one solution is the override that JavaScript function and give a new timeout value that fits your Silverlight application. Vladimir Buyevich’s blog gives very good information about this approach: Setting timeout for Silverlight web part
  4. Use HTML Web Part: Instead of using built-in Silverlight web part in SharePoint 2010, you can use HTML web part with toolbox parameter as xap url.

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

One thought on “Timeout problem with SharePoint Silverlight Web Part