Strange Crash

1078
2
11-10-2010 03:58 AM
MatthewPilgrim
New Contributor III
Hi,
I'm using the Silverlight MapPrinting example (with a couple of mods).  When panning and zooming in on an area I get a mysterious crash which I can't debug.  Running the process (without debuging) gives this error message:
Microsoft JScript runtime error: Unhandled Error in Silverlight Application Value was either too large or too small for an Int32.   at System.Convert.ToInt32(Double value)
   at System.Windows.PresentationFrameworkCollection`1.get_CountImpl()
   at System.Windows.PresentationFrameworkCollection`1.GetItemDependencyObject(Int32 index)
   at System.Windows.Controls.UIElementCollection.GetItemImplSkipMethodPack(Int32 index)
   at System.Windows.PresentationFrameworkCollection`1.CollectionEnum`1.get_Current()
   at ESRI.ArcGIS.Client.TiledLayer.getProgress()
   at ESRI.ArcGIS.Client.TiledLayer.bmi_DownloadProgress(Object sender, DownloadProgressEventArgs e, ImageTileInfo data, EventHandler`1 onProgressEventHandler)
   at ESRI.ArcGIS.Client.TiledLayer.<>c__DisplayClass8.<addTile>b__5(Object sender, DownloadProgressEventArgs e)
   at MS.Internal.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args)
   at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName)


I understand that a number was "too large or too small for an Int32" and that this may have come from "ESRI.ArcGIS.Client.TiledLayer.getProgress()".  Does anyone have any suggestions as to how I should avoid or catch this?

Thanks, Matt
0 Kudos
2 Replies
DominiqueBroux
Esri Frequent Contributor
Could you give more infos on how to reproduce this crash?
Does it look ramdom or does it happen each time after a specific sequence of actions?
0 Kudos
MatthewPilgrim
New Contributor III
Hi Dominique,

It occurs when heavily zooming in and out and panning.  A variation on the error just occurred:

Microsoft JScript runtime error: Unhandled Error in Silverlight Application
Code: 4004   
Category: ManagedRuntimeError      
Message: System.OverflowException: Value was either too large or too small for an Int32.
   at System.Convert.ToInt32(Double value)
   at System.Windows.PresentationFrameworkCollection`1.get_CountImpl()
   at System.Windows.PresentationFrameworkCollection`1.CollectionEnum`1.MoveNext()
   at ESRI.ArcGIS.Client.LayerCanvas.ArrangeOverride(Size finalSize)
   at System.Windows.FrameworkElement.ArrangeOverride(IntPtr nativeTarget, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight)    



If you mail me at "mattpil29 at google mail dot com" I'll send my slightly altered code.

Thanks, Matt
0 Kudos