Skip to main content

CRM 2011 - Debugging Silverlight Webresources without deploying

·192 words·1 min
Markus Konrad
Author
Markus Konrad
Blogger, Tekkie, Consultant, Developer

CRM 2011 - Debugging Silverlight Webresources without deploying
#

It finaly works!

Good week for CRM2011 developers!

  1. Release of new SDK

  2. New informations about WCF-Soap Endpoint

  3. Finding a solution for debugging silverlight webresources without deploying the webresources (My personal breakthrough! :))

Ok, first of all i would like to thank “erik-lp” from the MSDN forum for his tipps.

Following things are required for debugging your silverlight webresource.

  • Developing Machine (Same or other domain doesn’t mater)

  • CRM-Server (I have tested with RC)

  • clientaccesspolicy.xml

The clientaccesspolicy.xml

  • Navigate to the Web-Folder of your CRM-System. (..\Microsoft Dynamics CRM\CRMWeb)

  • Copy the created clientaccesspolicy.xml into this folder

  • Open your silverlight project in Visual Studio (For this example, we assume you are using the SOAP example from SDK version 5.0.1)

  • Navigate to the SilverlightUtility.cs class

  • Replace following code in the GetSoapService() Method

Before:

Uri serviceUrl = CombineUrl(GetServerBaseUrl(), “/XRMServices/2011/Organization.svc/web”); After:

Uri serviceUrl = new Uri(“http:///ORGNAME>/XRMServices/2011/Organization.svc/web”);

Now you can push F5 and start debuging.

This solutions only works in OnPremise Systems. You can not deploy clientaccesspolicy.xml in online systems.

Eric also talks about a ClientGlobalContext.aspx.js file. This is not required, if you replace the code in the SilverlightUtil.cs.

Happy coding!

cheers!