As part of a project, I created a program that collects external data at specific intervals (most often 1/second), and plot a graph out of it. Several times, while leaving the program running overnight as a stress test, the program sometimes encounter an ArgumentOutOfRangeException. Here is part of the exception output:
System.ArgumentOutOfRangeException:
Parameter: index
at
System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument
argument, ExceptionResource resource)
at System.Collections.Generic.List`1.get_Item(Int32 index)
at Macro_GUI.Macro_GUI.ChartReload_Part2()
at Macro_GUI.Macro_GUI.ChartReload()
at Macro_GUI.Macro_GUI.ScreenDataUpdate()
at Macro_GUI.Macro_GUI.ScreenTimer_Tick(Object sender, EventArgs e)
at System.Windows.Forms.Timer.OnTick(EventArgs e)
at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32
msg, IntPtr wparam, IntPtr lparam)
ChartReload_Part2() is part of the continous re-drawing of the graph. This time the error happened after a collection time somewhat longer than 17 hours.
Reading about ArgumentOutOfRangeException, it seems to most often have something to do with the Capacity of a List Collection (there are several uses of a List in the method). Anyone know if I am on the right track or if the problem is something else? Or have I given to little information for anyone to help?