Search code examples
silverlightclientaccesspolicy.xml

When and how to use clientaccesspolicy.xml in Silverlight


I am confused by when and how to use the clientaccesspolicy.xml file in Silverlight. What is it for? Right now, my deployed site (not localhost but the remote server) does NOT have it and I can still access the web site and query the database through a WCF web service. Why should I include it in my root directory?


Solution

  • You only need it if your Silverlight app will be accessing a service in another domain.

    e.g (from the MS site)

    "For example, a Silverlight control hosted at http://contoso.com/mycontrol.aspx can access only services on that same domain by default – for example http://contoso.com/service.svc, but not a service at http://fabrikam.com/service.svc."