I have a simple AGS map service. I accidentally specified an invalid SRID explicitly in my Silverlight XAML:
<esri:Map x:Name="Map" IsLogoVisible="False">
<esri:Map.Extent>
<esri:Envelope XMin="526801.81" YMin="489775.0655" XMax="593105.41" YMax="523904.2045">
<esri:Envelope.SpatialReference>
<esri:SpatialReference WKID="3807" />
</esri:Envelope.SpatialReference>
</esri:Envelope>
</esri:Map.Extent>
<esri:Map.Layers>
<esri:ArcGISDynamicMapServiceLayer x:Name="MyLayer" ID="MyService" Url="http://localhost/ArcGIS/rest/services/MyService/MapServer" Initialized="MyLayer_Initialized" InitializationFailed="Layer_InitializationFailed" />
</esri:Map.Layers>
</esri:Map>
This results in a RESTful request that looks like this:
http://localhost/ArcGIS/rest/services/MyService/MapServer/export?bbox=526801.8125,479254.134305427,593105.4375,534425.146944573&size=1078,897&format=png24&transparent=true&layers=show:0,1&f=image&imageSR=3807&bboxSR=3807
This request fails with the following IIS error:
Error Summary
HTTP Error 500.0 - Internal Server Error
The page cannot be displayed because an internal server error has occurred.
Detailed Error Information
Module ESRI.RestModule-Integrated
Notification ResolveRequestCache
Handler StaticFile
Error Code 0x00000000
If I replace the invalid SRID, everything works fine.
Is there any way to get the Silverlight API to report exceptions like this? As it is I have to use Fiddler to find it.