kuiperfoliage

SetupDecoderFromUriOrStream when loading Map from ArcGIS

Discussion created by kuiperfoliage on Nov 10, 2011
Latest reply on Nov 12, 2011 by kuiperfoliage
It seems that Esri is doing some updates on some of their maps which causes this following exception to be thrown:

System.NotSupportedException
No imaging component suitable to complete this operation was found.
   at System.Windows.Media.Imaging.BitmapDecoder.SetupDecoderFromUriOrStream(Uri uri, Stream stream, BitmapCacheOption cacheOption, Guid& clsId, Boolean& isOriginalWritable, Stream& uriStream, UnmanagedMemoryStream& unmanagedMemoryStream, SafeFileHandle& safeFilehandle)
   at System.Windows.Media.Imaging.BitmapDecoder.CreateFromUriOrStream(Uri baseUri, Uri uri, Stream stream, BitmapCreateOptions createOptions, BitmapCacheOption cacheOption, RequestCachePolicy uriCachePolicy, Boolean insertInDecoderCache)
   at System.Windows.Media.Imaging.BitmapImage.FinalizeCreation()
   at System.Windows.Media.Imaging.BitmapImage.EndInit()
   at ESRI.ArcGIS.Client.TiledLayer.tileLoadCompleted(ImageTileInfo data, Stream imgStream, Exception error)
   at ESRI.ArcGIS.Client.TiledLayer.client_DownloadDataCompleted(Object sender, DownloadDataCompletedEventArgs e)
   at System.Net.WebClient.OnDownloadDataCompleted(DownloadDataCompletedEventArgs e)
   at System.Net.WebClient.DownloadDataOperationCompleted(Object arg)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)


How can I catch this exception for the layer ? It seems this exception is now thrown on a background thread and crashes the whole app. This exception should be reported to InitializationFailed on the Layer.

It happens when loading the following through XAML

            <esri:ArcGISTiledMapServiceLayer ID="BaseLayer" 
          Url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer" />

Outcomes