none
Could not download the Silverlight application or the Silverlight Plugin did not load. (Silverlight & SharePoint 2010 integration)

    Question

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

    Hi,

    I have Sharepoint 2010 website & some UI part developed in SilverLight 4.

    If I run silverlight application through localhost, the application works correctly. But after deploying xap file in sharepoint, webpart gives following error even though i have silverlight plug-in installed in browser.

     

    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

     

    The error flashes till complete webpart doesn't get cached in browser (1st time after 20%, 2nd 40%--- so on) 

    Note: XAP file is as heavy as 1.5 MB...

     

    Let me know if anybody have solution or suggestions

     

    Thanks & Regards,

    Saurabh

    Monday, August 16, 2010 5:54 AM

Answers

  • Hey Saurabh,

    The same thing happened to me as well. Apparently (judging from this thread), SharePoint will "timeout" the web part if the Silverlight application isn't loaded after 5 seconds.

    I've forwarded many Microsoft employees this question but never got a straight answer regarding if its true or not.

    Did you try to reduce the xap size by catching its dll? (right click on the project->properties->Silverlight tab->check "Reduce XAP size by using application library caching")


    Best regards, Johnny. My blog - http://blogs.microsoft.co.il/blogs/johnnyt
    • Marked as answer by Wayne Fan Friday, August 27, 2010 6:37 AM
    Tuesday, August 17, 2010 1:37 PM

All replies

  • Did you see the silverlight app open up when you added it to the silverlight webpart? I think that you should see a 'preview' there.

    If you don't, then it is likely either a incorrect path to where the xap file is stored (site assets library?), or there is something wrong with the silver light app that stops it from rendering.

    Perhaps this could also be due to incorrect formatting of the webpart(width, height...)? (To re-configure the Web Part )

    Good luck!

     


    Thomas Balkeståhl - Technical Specialist - SharePoint
    Monday, August 16, 2010 1:20 PM
  • Hey Saurabh,

    The same thing happened to me as well. Apparently (judging from this thread), SharePoint will "timeout" the web part if the Silverlight application isn't loaded after 5 seconds.

    I've forwarded many Microsoft employees this question but never got a straight answer regarding if its true or not.

    Did you try to reduce the xap size by catching its dll? (right click on the project->properties->Silverlight tab->check "Reduce XAP size by using application library caching")


    Best regards, Johnny. My blog - http://blogs.microsoft.co.il/blogs/johnnyt
    • Marked as answer by Wayne Fan Friday, August 27, 2010 6:37 AM
    Tuesday, August 17, 2010 1:37 PM
  • Hi,

     

    I think 5sec limit is imposed by silverlight webpart. To avoid that use HTML Form webpart and keep your SL xap embedded code in it. And add   MS.SP.url  param in Init params section. For full code see my blog http://nareshbojja.wordpress.com/2010/12/02/could-not-download-the-silverlight-application-or-the-silverlight-plugin-did-not-load/

     

    Thanks,

    NB

     


    Naresh Bojja http://nareshbojja.wordpress.com
    Thursday, January 20, 2011 11:58 PM
  • I have the same timeout issue. Here are the steps I took.

    I read Vladimir Buyevich's post here http://buyevich.blogspot.com/2011/02/setting-time-out-for-silverlight-web.html

    I first tried the Content Editor Web Part to inject Javascript but I discovered that the Javascript gets inserted at the wrong place.

    Next I went to the Master Page and placed the Javascript at the end of the page. I used this:

    <script type="text/javascript">
     window.setTimeout("alert('Silverlight Webpart failed to load in time')", 60000);
    </script>

    This should overwrite the earlier Silverlight Web Part part setting of 5 seconds for the window timeout and make it 60 seconds.

    This has not worked for me. The Silverlight Web Part still times out around 5 seconds and after 60 seconds I get my alert.

    I also tried Vladimir's approach of replacing the called function

    <script type="text/javascript">
    function _spCheckIfSilverlightPluginIsLoaded_WebPartctl00_m_g_0f7cd87d_f3fd_49d9_91ec_ad4b46cfe999(){}
    </script>

    Neither of these approachs work for me. Either there is another timeout somewhere or the Javascript timing is wrong.

    This is URGENT. Without a fix for this, we cannot deploy Silverlight with SharePoint in any meaningful application.

    Has anyone found a solution for SharePoint 2010?

    Thanks,

    d

    • Proposed as answer by Alok Thakkar Tuesday, April 12, 2011 5:26 PM
    • Unproposed as answer by Alok Thakkar Tuesday, April 12, 2011 5:26 PM
    Friday, March 25, 2011 9:41 PM
  • I have the same timeout issue. Here are the steps I took.

    I read Vladimir Buyevich's post here http://buyevich.blogspot.com/2011/02/setting-time-out-for-silverlight-web.html

    I first tried the Content Editor Web Part to inject Javascript but I discovered that the Javascript gets inserted at the wrong place.

    Next I went to the Master Page and placed the Javascript at the end of the page. I used this:

    <script type="text/javascript">
     window.setTimeout("alert('Silverlight Webpart failed to load in time')", 60000);
    </script>

    This should overwrite the earlier Silverlight Web Part part setting of 5 seconds for the window timeout and make it 60 seconds.

    This has not worked for me. The Silverlight Web Part still times out around 5 seconds and after 60 seconds I get my alert.

    I also tried Vladimir's approach of replacing the called function

    <script type="text/javascript">
    function _spCheckIfSilverlightPluginIsLoaded_WebPartctl00_m_g_0f7cd87d_f3fd_49d9_91ec_ad4b46cfe999(){}
    </script>

    Neither of these approachs work for me. Either there is another timeout somewhere or the Javascript timing is wrong.

    This is URGENT. Without a fix for this, we cannot deploy Silverlight with SharePoint in any meaningful application.

    Has anyone found a solution for SharePoint 2010?

    Thanks,

    d

     

     

    Hi,

    I was facing a similar issue. So to resolve this issue I have put my xap and related assemblies (I am using 3rd party silverlight chart control) in to C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\ClientBin. Further given relative URL (/_layouts/ClientBin/<yourfilename>.xap.

    This has successfully loaded the .xap file without any issue.

    Hope this helps!!!

    Alok



    Alok
    Tuesday, April 12, 2011 5:30 PM
  • Hi Alok,

    I've reviewed my post and found the part on replacing of called function a bit confusing. I mentioned that web part id is a part of function name (which actually means function name is unique for every page) but didn't highlight that. Sorry about that.

    I updated the post and there is a span shot  from it:

    the easiest way to handle it is to eliminate time out at all by creating same named dummy JavaScript function:

    1. Go to page source and search for _spCheckIfSilverlightPluginIsLoaded_WebPart phrase. You suppose to find function which starts with this phrase. Copy function name to clipboard.

    2. Add content editor web part after Silverlight web part and put empty JavaScript function with saved name there like that

    <script type="text/javascript">
    function _spCheckIfSilverlightPluginIsLoaded_WebPartctl00_m_g_0f7cd87d_f3fd_49d9_91ec_ad4b46cfe999(){}
    </script>

    where_spCheckIfSilverlightPluginIsLoaded_WebPartctl00_m_g_0f7cd87d_f3fd_49d9_91ec_ad4b46cfe999 is a function name I've found on my page. 

    Hope this is more helpful.

    BTW. It could check out my custom web part in codeplex. It actually does everything programmatically: finds Silverlight web part on the page and renders empty function with proper name.

    Regards,


    Vladimir
    MCTS, SharePoint tips blog: http://buyevich.blogspot.com
    Tuesday, April 12, 2011 8:38 PM
  • You can also get this same error if you've uploaded your Silverlight web part into a SharePoint publishing site and forgotten to publish the .xap file.  The default path to the .xap file after uploading seems to be ~site/_catalogs/masterpage/ClientBin/<name of app>/??.xap.  Wasted quite a bit of time pursuing the timeout solution, IIS, permissions etc then discoverd it had to be published before users could view it. 


    Wednesday, August 17, 2011 7:28 PM
  • Hello Alok,

    I tried this as follows. I placed the xap in the directory you indicated and added the Silverlight Web Part to the aspx page with the relative URL /_layouts/ClientBin/MySLPart.xap

    The Javascript generated for the page still shows the 5 second timeout via the _spCheckIfSilverlightPluginIsLoaded_WebPartctl00_m_g_<guid> so I can see no difference in this approach. Please advise how you were able to get this to work.

    Thanks

    Friday, December 16, 2011 7:06 PM
  • Vladimir,

    Do you have any idea where the GUID comes from after the _spCheckIfSilverlightPluginIsLoaded_WebPartctl00_m_g_ ?

    I looked at the list containing the XAPs in the field GUID or ows_UniqueID and others to see if I could find it. The GUID is only regenerated when the XAP file is refreshed (it is not unique to the page). If it is somewhere in the list, then I could automatically regenerate the necessary empty functions each time the XAPs are refreshed.As it is at the moment if you have hundreds of XAPs, it is a painful job!

    Thanks

    Friday, December 16, 2011 7:21 PM
  • Hi,

    Please check the source code of my web part at http://sltimeout.codeplex.com/releases/view/61213

    The m_g_{Guid} is a the ClientID of the SilverLightWebPart. It doesn't depend on the XAP file.

    Regards,


    Vladimir
    MCP, MCTS, SharePoint tips blog: http://buyevich.blogspot.com
    Friday, December 16, 2011 7:42 PM