locked
Debug Silverlight app in CRM 2011 RRS feed

  • Question

  • How can I debug a silverlight app from CRM, or run from VS2010, that uses ODATA connection?

    Thanks!

    Wednesday, June 29, 2011 1:58 PM

Answers

  • Two possibilities,

    1. Check out the app.xaml. I hope you have set the correct xaml class file to start your application.

    2. Check out the IE Tools -> Internet options -> advance tab -> disable script debugging (Internet explorer). This option needs to be checked. Keep it disable.

     

     


    Thanks, Ankit Shah
    Inkey Solutions, India.
    Microsoft Certified Business Management Solutions Professionals
    http://www.inkeysolutions.com/MicrosoftDynamicsCRM.html
    Saturday, July 2, 2011 2:29 PM

All replies

  • Hi Lenard,

    You can debug from Visual Studio by choosing 'Attach to Process' and attaching to the iexplore.exe process that is running your silverlight application. Be careful to make sure the code in Visual Studio is identical to the code uploaded to CRM.

    Hope that helps.

    Kirsten

    • Proposed as answer by Philippe LEAL Thursday, December 1, 2011 2:28 PM
    Wednesday, June 29, 2011 2:07 PM
  • I tried this, but after a a build the project, I upload it to the crm. The VS didn't stops at the breakponint. I don't know why.
    There is some way to test your app, from VS, not to upload it to crm?

     

    Wednesday, June 29, 2011 2:15 PM
  • I don't think there is an easy way of debugging your silverlight application if it is using data from within CRM. Debugging remotely from Visual Studio can be long winded, but it should work.

    When you attach to the process from within Visual Studio, are the breakpoints loaded? I.e. are they red or are they yellow circles with an error message saying symbols cannot be loaded? You might want to double check you are attaching to the right process. When you choose 'Attach to Process' you can select to attach to Silverlight code, which can help in narrowing down the right process to attach to.

    Kirsten

    Wednesday, June 29, 2011 2:23 PM
  • Kristen has the start of the process correct. Just some additional best practices which should solve your problem:

    • In the "Attach to" field, select only the "Silverlight code" option.
    • It helps to attach to all open IE processes just to be sure you've got a hook into it.
    • Also make sure that like usual, you don't make any changes between uploading the XAP to CRM and attaching to debug.
    • One final thing would be to clear your cache, in case the XAP has been run previously (open dev toolbar and click the clear cache button or do this from tools->internet options, Ctrl+R/Ctrl+F5 doesn't always work).
    Wednesday, June 29, 2011 2:35 PM
  • You can debug silverlight code on your own machine that uses data from a separate CRM server. You just have to set up the correct ClientAccessPolicy.xml file on the CRM server. See this post for details:  http://mkonrad.blogspot.com/2011/02/crm-2011-debuggin-silverlight.html  I've only used this technique with the SOAP OrganizationService, but it should work with the REST service too.

    If you can't put the clientaccesspolicy file on the server (or if you use CRM online), then there's other techniques you can use such as creating a proxy.

     


    Erik Pool | http://www.avanadeblog.com/xrm/ 
    Wednesday, June 29, 2011 5:05 PM
  • I tried your proposals. I have break points at every part of the code. I connect to the Silverlight process. In VS I se thet the connection is on, but it didn't stop at any pont of the code. I put it in the entity, and I treid to call the html file that loads the silverlight app. I don't understand what is the prolbem.

     


    On other pc I managed to debug the application. In the olde one that doesn't work in the Soulition Explorere appears a Script Documets entry when I start the debugging. In the other VS where the debugging works correctly didn't appeard this point. What can the problem be?
    Thursday, June 30, 2011 10:06 AM
  • Two possibilities,

    1. Check out the app.xaml. I hope you have set the correct xaml class file to start your application.

    2. Check out the IE Tools -> Internet options -> advance tab -> disable script debugging (Internet explorer). This option needs to be checked. Keep it disable.

     

     


    Thanks, Ankit Shah
    Inkey Solutions, India.
    Microsoft Certified Business Management Solutions Professionals
    http://www.inkeysolutions.com/MicrosoftDynamicsCRM.html
    Saturday, July 2, 2011 2:29 PM
  • After checking the disable script degubbing, the debugging works. It was unchecked for JS debugging.

    Thanks for the help!

    Monday, July 4, 2011 9:10 AM
  • Tip 2 rocks!! I was going mad why it was not working.

    Thank you so much for the suggestion.


    - Arvind

    Wednesday, October 3, 2012 10:36 AM
  • What did the trick for me, at least using Silverlight 4, was using the 32bit version of IE.
    Monday, August 5, 2013 6:14 PM