FAQs

This topic includes some of the problems ArcGIS API for Silverlight developers encounter in their developement, and solutions for those issues. They include the following problems:

Problem: I cannot load data from my server

  1. If accessing ArcGIS Server services, make sure that the ArcGIS Services Directory is set up and functioning. Navigate to http://<host>/arcgis/rest/services in a browser. See Discovering services for more information.
  2. Make sure the REST endpoint for the service is available. Copy and paste the URL defined in your Silverlight application into a browser. For example, http://<host>/arcgis/rest/services/USA/MapServer.
  3. If your Silverlight application is not hosted on the same server or domain as the data (services) you are accessing, you need a clientaccesspolicy.xml file on the remote server. See the next problem for more information.
  4. Use the InitializationFailure event on the layer to determine if an error is occurring, and interrogate the error message.
  5. View the HTTP request and response using a standard tool for interrogating HTTP communication. For example Fiddler, Silverlight Spy, FireBug (FireFox add-on), and so on, to determine if a failure has occurred.

Problem: I cannot load data from an external data source outside my application's domain

To access data from a remote server (a different server from the one where your Silverlight application is hosted), the remote server needs to have a clientaccesspolicy.xml file in the web servers' root directory. For security reasons, a web browser is not allowed to access data that resides outside the exact web domain where the compiled Silverlight application (XAP) file originated. However, a Silverlight application can load data across domains if permission is granted from the server. This is accomplished by having a small clientaccesspolicy.xml file on the remote server that permits Silverlight to connect to services on that server. For additional information, read the topic Making a Service Available Across Domain Boundaries. For more information on the structure and function of a clientaccesspolicy.xml file, read the topic Network Security Access Restrictions in Silverlight.

As an example, you can view the policy file used by ArcGIS Online at http://services.arcgisonline.com/clientaccesspolicy.xml.

Problem: Tasks return a limited number of features

By default, queries against ArcGIS Server 9.3.1 services are limited to returning 500 features and services in ArcGIS Server 10 and later are limited to 1000 features at a time. If you have access, the limit can be modified on the server. If not, iterate through consecutive blocks of results on the client by using the field that contains a unique key (for example, primary key) to track progress.

Problem: Accessing a Silverlight application on a web server returns error code 2103 in the browser

This error may indicate that a set of MIME types needed to support Silverlight applications must be added to the web server that hosts your application. Add the following MIME types:

.xaml application/xaml+xml

.xap application/x-silverlight-app

.xbap application/x-ms-xbap

If necessary, use Microsoft's Configuring IIS for Silverlight Applications document as a guide.

Problem: PrintTask returns an exception or does not generate output that matches the Map or Legend control

The PrintTask uses the ArcGIS Server 10.1 Export Web Map task to generate printable output that contains a map and optional surrrounds (such as a scale bar, legend, and so on). The following issues should be considered when preparing map contents for use with the PrintTask:

6/23/2013