I want to check service type pragmatically and add corresponding service (Dyanamic or Tiled) on map. If i tried to add globe service as
"ArcGISDynamicMapServiceLayer" then code doesn't reached to Initialized or InitializedFailed event.
See below code for reference..
<esri:ArcGISDynamicMapServiceLayer ID="StreetMapLayer" Initialized="ArcGISDynamicMapServiceLayer_Initialized"
On run time, i am getting below exception and i am not able to catch.
Error: Unhandled Error in Silverlight Application
Message: System.NullReferenceException: Object reference not set to an instance of an object.
Any help would be appreciated.
Neither ArcGISDynamicMapServiceLayer nor ArcGISTiledMapServiceLayer supports globe server.
So in both cases the layer will fail to initialize.
If you want to check if a service supports dynamic or tiled, you can create an ArcGISTiledMapServiceLayer.
If the initialization is OK, it means that the service is cached with the right SR so using an ArcGISTiledMapServiceLayer is the best choice for performances.
If the initialization fails, we can fallback to create an ArcGISDynamicMapServiceLayer. If the initialization fails, likely the service is not supprted (e.g. globe server) else you can use the ArcGISDynamicMapServiceLayer.