Export (0) Print
Expand All
0 out of 4 rated this helpful - Rate this topic

Warning: Could not locate cross-domain policy at '<URL>'

Silverlight

A cross-domain policy file for the service was not found at the specified URL.

If a Silverlight 5 application needs to access a service in another domain, the service must explicitly opt in to enable cross-domain access. By opting in, a service affirms that the operations it exposes can safely be invoked by a Silverlight 5 control, without potentially damaging consequences to the data that the service stores.

To use a clientaccesspolicy.xml file to enable cross-domain access

  1. Create a clientaccesspolicy.xml file that enables access to the service. The following configuration enables access from any other domain to all resources on the domain in which the clientaccesspolicy.xml file is located.

    <?xml version="1.0" encoding="utf-8"?>
    <access-policy>
      <cross-domain-access>
        <policy>
          <allow-from>
            <domain uri="*"/>
          </allow-from>
          <grant-to>
            <resource path="/" include-subpaths="true"/>
          </grant-to>
        </policy>
      </cross-domain-access>
    </access-policy>
    

    Alternatively, if you want to enable access form only one other domain, such as http://contoso.com, the clientaccesspolicy.xml should contain the following configuration.

    <?xml version="1.0" encoding="utf-8"?>
    <access-policy>
      <cross-domain-access>
        <policy>
          <allow-from>
            <domain uri="http://contoso.com"/>
          </allow-from>
          <grant-to>
            <resource path="/" include-subpaths="true"/>
          </grant-to>
        </policy>
      </cross-domain-access>
    </access-policy>
    
  2. Save the clientaccesspolicy.xml file to the root of the domain in which the service is hosted. If, for example, the service is hosted on http://fabrikam.com, the file must be located at http://fabrikam.com/clientaccesspolicy.xml.

  3. Test that the access is enabled by invoking the service from your application.

To use a crossdomain.xml file to enable cross-domain access

  1. Create a crossdomain.xml file that contains the following configuration. The file must be configured to enable access to the service from any other domain, or it is not recognized by Silverlight 5.

    <?xml version="1.0"?>
    <!DOCTYPE cross-domain-policy SYSTEM _
    "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
    <cross-domain-policy>
      <allow-access-from domain="*" />
    </cross-domain-policy>
    
  2. Save the crossdomain.xml file to the root of the domain in which the service is hosted. If, for example, the service is hosted on http://fabrikam.com, the file must be located at http://fabrikam.com/crossdomain.xml.

  3. Test that the service is enabled by invoking the service from your application.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.