Search This Blog

June 19, 2012

Unhandled Error in Silverlight Application - ESRI.ArcGIS.Client.Layer.OnInitializationFailed

Our Silverlight Project is based on ArcGIS Map Services and the site is for internal use only in the company.

I can use my local machine to access the sites outside the company successfully such as , but for Windows Server 2008 R2 machines,  I can only browse the internal sites including our Silverlight Application.

When I launch our Silverlight Application, the site is good and has no JavaScript error. But when I run my Silverlight UI automation on Windows Server 2008 R2 machine, the site has the following JavaScript error and it is related to ArcGIS error.

Message: Unhandled Error in Silverlight Application A security exception occurred while trying to connect to the REST endpoint. Make sure you have a cross domain policy file available at the root for your server that allows for requests from this application.   at ESRI.ArcGIS.Client.Layer.OnInitializationFailed(EventArgs e)
   at ESRI.ArcGIS.Client.ArcGISTiledMapServiceLayer.<>c__DisplayClass1a.b__18()

After investigation, our map service needs to have the Internet connection first. When I get the values of proxy server configuration from my QA manager and configure it correctly in IE, the JavaScript error is gone after launching Silverlight Application again.

No comments: