locked
Silverlight unhandled exception on AddGallery.aspx RRS feed

  • Question

  • I installed SharePoint 2010 beta on a standalone box.  If I access SharePoint from that box, I can create new sites when the AddGallery.aspx page popus with the Silverlight control in it with no problem.  From any other machine I get:

    An unhandled exception occurred in the Silverlight application.

    Has anyone seen this error and if so have you found a workaround?

    Russ Farris
    Tuesday, November 24, 2009 2:31 PM

Answers

  • I'm not sure which fixed it but I'm going to explain what I did from the beginning:

    1) Setup SP2010 on Windows 7 according to the MSDN documentation
    2) When the root site came up (http://localhost) and it asked me to pick a template I selected Enterprise Wiki
    3) After experiencing the error I described, I activated all features on the site and site collection.
    4) I also reset the site definition.

    After steps 3 and 4 the errors went away and I could use the silverlight controls with no problem.  Again, I'm not sure which one solved it.  I could probably diagnose it again but I'm a little anxious to get looking at SP 2010 so I'll save that for later.  Just wanted to share what I found.
    Russ Farris
    • Marked as answer by RussFarris Thursday, November 26, 2009 6:00 AM
    Thursday, November 26, 2009 6:00 AM

All replies

  • You don't use ip address to access it, right? This might be the cause.
    Paul Shkurikhin blog.sharepointalist.com
    Tuesday, November 24, 2009 7:05 PM
  • I don't use the ip address to access it.  I created an alternate access mapping for it and that works fine as well.  It only seems to be an issue with anything that uses silverlight.  If I uninstall silverlight the issue goes away and I can create new sites with the aspx pages fine.
    Russ Farris
    Tuesday, November 24, 2009 9:25 PM
  • I'm not sure which fixed it but I'm going to explain what I did from the beginning:

    1) Setup SP2010 on Windows 7 according to the MSDN documentation
    2) When the root site came up (http://localhost) and it asked me to pick a template I selected Enterprise Wiki
    3) After experiencing the error I described, I activated all features on the site and site collection.
    4) I also reset the site definition.

    After steps 3 and 4 the errors went away and I could use the silverlight controls with no problem.  Again, I'm not sure which one solved it.  I could probably diagnose it again but I'm a little anxious to get looking at SP 2010 so I'll save that for later.  Just wanted to share what I found.
    Russ Farris
    • Marked as answer by RussFarris Thursday, November 26, 2009 6:00 AM
    Thursday, November 26, 2009 6:00 AM
  • I am experiencing the same issue - unable to create lists or libraries using IE8.  Oddly enough, I can still work through Firefox 3 with the Silverlight app - although since there are still ActiveX controls is in SP2010, I'm sortof stuck without being able to accomplish certain actions (like, oddly enough, MFU).  I'm also able to connect with a different machine without problem. 

    Wondering if my VPN is causing this problem. 

    What's vexing is I can't determine where to look to see if the error is being logged anywhere on my machine. 
    Thursday, December 3, 2009 2:34 PM
  • Hi, I struggled with this error as well and have found a solution that I wanted to share in case others have the same problem.  The issue I had was in SharePoint 2010 Beta 2, the Silverlight controls were working perfectly in Firefox 3.5 but would throw an error every time using IE 7.  The error message I got in IE was:

    "Error
    An unhandled exception occurred in the Silverlight Application."


    The issue that I found was a javascript error on the AddGallery.aspx page that was causing the issue.  Since it was a client-side error, it was not getting logged on the server at all.   These are the steps that worked for me:

    1. Open the AddGallery.aspx page in the SharePoint hive in the TEMPLATE -> LAYOUTS directory:
    C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS
    (You may want to create a copy of this file to be safe)

    2. Find line 110 and comment out this line:
    var xmlHttp = new XMLHttpRequest(); 

    so line 110 now reads
    // var xmlHttp = new XMLHttpRequest();


    3.  Below (or above) this commented out line add this code:
    var xmlHttp;
    if (window.XMLHttpRequest)
    {
        // If IE7, Mozilla, Safari, etc: Use native object
        xmlHttp = new XMLHttpRequest()
    }
    else if (window.ActiveXObject)
    {
        // ...otherwise, use the ActiveX control for IE5.x and IE6
        xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
    }



    4. Save this file and then retry the Site Actions -> New Site link in IE.

    The problem seems to be that for some reason it cannot create the XMLHttpRequest object.  I'm using IE 7 (7.0.5730.13CO to be precise) and this should be a native object in IE 7, but the code just doesn't work for me.  Now the AddGallery.aspx page works for me in IE and Firefox.  

    Hope this gets fixed in the next release.  Even if the code doesn't make much sense to need, it's better to have a fallback so it doesn't throw such a fatal error.
    Monday, December 28, 2009 8:12 PM
  • This code appears to only address the instantiation of the selection dialog. I get the error after I select a list type and then click the "Create " button. I will have to declared the code further when time permits...
    Jim Wilt [MVP, MCA-Solutions]
    Tuesday, January 5, 2010 9:19 PM
  • I have this problem too, but this solution didn't works for me.
    I have IE8.

    Do you have any other suggestion?

    Thanks

    Wednesday, January 27, 2010 2:35 PM
  • IE 8

    Tools - internet options - Advanced

    Under Security, Select "Enable native XMLHTTP support"
    Enabling this fixed my "An unhandled exception occurred in the Silverlight application" error

    Monday, March 22, 2010 11:58 PM
  • This fixed it! Interesting, I had disabled this to fix an issue in SharePoint 2007 which causes a long delay when you try and exit a page that you have in edit mode without saving your changes.

     

    Thursday, April 8, 2010 9:50 PM
  • Ha....yep, same thing here.  I had turned off that in 2007 to get rid of the long delay.  Turned it back on and fixed the error.  That took me literally like 6 hours to figure out until I stumbled upon this post.  Thankyamuch!
    Thursday, April 29, 2010 2:05 PM
  • This topic http://www.sharepointoverflow.com/questions/2880/silverlight-unhandled-exception-on-addgallery-aspx solve the problem at my case.

    Best regards from Germany

    Joerg-Benjamin Mueller

     

    Tuesday, July 20, 2010 11:36 AM
  • Turning Security Validation back on in the web application settings of Central Administration fixed this for me instantly as well.

    1. Central Admin > Web Application Management
    2. Select the Web Application
    3. On the Ribbon, General Settings
    4. Scroll Down to the Security Validation section. 
    5. I originally turned it completely off, this caused the issue (is this required for non-anon sites Microsoft?)
    6. I truned it back on with no expiration and it immediately resolved the issue, no IIS reset, service restart or timer job wait needed!

    -Mark

    • Proposed as answer by rockridder Thursday, April 21, 2011 3:34 PM
    Tuesday, March 29, 2011 8:52 PM
  • thanks a ton mark.

    your solution worked for me

    saved a lot of time.

    thanks again ! :)

    Wednesday, February 22, 2012 9:33 AM
  • Nice one Mark. Was beginning to look like a time consuming problem. Mark's fix worked first time.
    Wednesday, July 18, 2012 12:39 PM
  • Over a year later and still helping out.  Thank you for posting, Mark.  Your solution resolved the problem for me.


    • Edited by T-Daddy Friday, July 20, 2012 7:47 PM Typo
    Friday, July 20, 2012 7:46 PM