Silverlight Web Resource Screens in a Custom Sitemap Area - Not Working in Online

Answered Silverlight Web Resource Screens in a Custom Sitemap Area - Not Working in Online

  • Thursday, August 16, 2012 9:30 PM
     
     

    Hi,

    My team is building an application that uses a custom sitemap node. When that node is clicked by the user, there is a Silverlight page that displays a custom interface to the user.

    Everything works in CRM 2011 on-premise, but in CRM Online the Silverlight component never shows up - you just get a white space in the main application pane. If you right-click, you can see the Silverlight right-click menu, but the interface never shows up.

    Has anyone seen this before?

    Thanks!


    Blog: http://andrewbschultz.com @andrewbschultz

All Replies

  • Friday, August 17, 2012 7:57 AM
     
     
    Yes i have seen this issue in my project. Please check the size of your xap file. Because it is in local server (on-premise) that's way it loads very fast but in online environment it takes alot of time to load the same file. I think due to some server load may be. But in my case it will start loading after few tries.

    I hope this helps. If my response answered your question, please mark the response as an answer and also vote as helpful.
    Mubasher Sharif
    Check out my about.me profile!
    http://mubashersharif.blogspot.com
    Linked-In Profile
    Follow me on Twitter!


  • Friday, August 17, 2012 5:57 PM
     
     
    It sounds like the app may be throwing an error, have you tried debugging it?
  • Monday, August 20, 2012 4:38 PM
     
     

    Thanks Mubasher, that sounds like it might be the same issue. Which XML file - do you mean the XAP file? Did you find a pragmatic limit to the file size you could use in CRM Online?

    Thanks!

    Andy


    Blog: http://andrewbschultz.com @andrewbschultz

  • Monday, August 20, 2012 4:39 PM
     
     

    It works in On-premise, and it's unit-tested and UI tested, so I don't think that's the issue.

    Thanks,

    Andy


    Blog: http://andrewbschultz.com @andrewbschultz

  • Thursday, August 23, 2012 11:22 AM
     
     

    Andrew,

    Did you have any luck with this? I'd be interested (and surprised) to know about the size limit. I've written quite a few Silverlight controls for hosting in CRM and haven't had a problem, although we did have problems with the size of the solution files.

    I suggested debugging it for 2 reasons:

    1. To establish whether it's getting into your code at all.

    2. Just in case there was some difference in the environments (presumably the data is different) that may be causing it.

    Regards,

    LJ

  • Thursday, August 23, 2012 11:37 AM
     
     Answered

    Inside your xaml.cs, the getserverurl() method maybe returning a slash after the server name. If i remember this correctly, this happens in CRM Online..

    if your code is: getseverurl() + "/XRMservices.......svc";

    It gets  "https://servername//Xrmservices...............

    Try removing the slash before Xrmservices...so it should look like this:  getseverurl() + "XRMservices.......svc";

    Hope thats the reason..


  • Thursday, August 23, 2012 12:59 PM
     
     

    Thanks John,

    We haven't debugged in CRM Online yet. The data differences shouldn't be an issue, but we may have to debug and see. The solution file was huge; the import hung for several hours twice before successfully going in.

    Thanks,

    Andy


    Blog: http://andrewbschultz.com @andrewbschultz

  • Thursday, August 23, 2012 12:59 PM
     
     

    Thanks SwetaGupta,

    Maybe I can get into Fiddler and see if I can find the URL it's calling.

    Best,

    Andy


    Blog: http://andrewbschultz.com @andrewbschultz

  • Thursday, August 23, 2012 1:30 PM
     
     

    Hi Guys,

    3 main points, in bold below:

    Hmmm ... there is a 500 error being returned by the server for the request of the WebResource.ashx file. Isn't this just a standard CRM file?

    </exception>
      <parameters xsi:nil="true" />
      <displaytitle />
      <displaytextencoded />
      <displaytext />
      <description>The file '/ORGNAME/Handlers/WebResource.ashx' does not exist.</description>
      <file>Not available</file>
      <line>Not available</line>
      <details>The file '/ORGNAME/Handlers/WebResource.ashx' does not exist.</details>
      <traceInfo />
      <requesturl>http://ORGNAME.crm.dynamics.com/ORGNAME/Handlers/WebResource.ashx?name=DDD_xap_Targets</requesturl>
      <pathAndQuery>/ORGNAME/Handlers/WebResource.ashx?name=DDD_xap_Targets</pathAndQuery>
      <source>ASHX_XML</source>
      <stacktrace />
    </error>

    Also, if I go to the DDD_xap_Targets web resource, the URL is the following - I do see  a double / in the path in the Online version, not in the on-premise version.

    On-premise:
    http://SERVERNAME/ORGNAME/WebResources/DDD_xap_Targets

    Online:
    https://ORGNAME.crm.dynamics.com//WebResources/DDD_xap_Targets

    If I compare the request headers for the on-premise version that works and the online version that does not, I see some key differences:

    On-premise:
    GET /ORGNAME/%7B634812405270000000%7D/WebResources/DDD_page_Targets?pagemode=iframe HTTP/1.1

    Online:
    GET /ORNAME/WebResources/DDD_xap_Targets HTTP/1.1

    I'm not sure if that's a normal difference between the two environments ... but we haven't manually changed the paths or names of the web resources.


    Blog: http://andrewbschultz.com @andrewbschultz




  • Thursday, August 23, 2012 3:20 PM
     
     

    I am not sure if you know how to do it - but a better way of understanding the error would be to debug the Silverlight code itself - it may be faster and more helpful. 

    You need to open the code in VS and attach the debugger to the Silverlight x86 process and also the IE instance that has the CRM online website opened. Once your SL code starts loading, it will hit the break point. Just ensure that the VS debugger is attached to the same IE instance which is loading your SL control. For all you know, it could be simply the // while it is trying to call getserverurl() in order to construct the "organizationdata.svc" url


    The double hash problem i mentioned maybe what is indicated in fiddler as well, but i am not sure if its the same thing.
  • Friday, September 28, 2012 1:42 AM
     
     

    Thanks SwetaGupta,

    It was related to how we called the CRM Online web services. We made a few changes and that fixed the problem!

    Thanks,

    Andy


    Blog: http://andrewbschultz.com @andrewbschultz