Bug 59767 - Specified argument was out of the range of valid values. Parameter name: index
Summary: Specified argument was out of the range of valid values. Parameter name: index
Status: RESOLVED DUPLICATE of bug 59412
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 2.3.4
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2017-09-26 18:36 UTC by Wallace Santos
Modified: 2017-09-26 18:44 UTC (History)
2 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Wallace Santos 2017-09-26 18:36:28 UTC
When my app (iOS / Android) try to refresh a ListView, sometimes this error happens:

Message: Specified argument was out of the range of valid values. Parameter name: index
Stack trace:
at Xamarin.Forms.ListProxy.get_Item (System.Int32 index) [0x0000b] in C:\\BuildAgent3\\work\\ca3766cfc22354a1\\Xamarin.Forms.Core\\ListProxy.cs:124 \n  at Xamarin.Forms.ListProxy.System.Collections.IList.get_Item (System.Int32 index) [0x00000] in C:\\BuildAgent3\\work\\ca3766cfc22354a1\\Xamarin.Forms.Core\\ListProxy.cs:433 \n  at Xamarin.Forms.TemplatedItemsList`2[TView,TItem].get_Item (System.Int32 index) [0x00008] in <6e20d7af277949f4a7bb952d64b81cda>:0 \n  at Xamarin.Forms.Platform.iOS.ListViewRenderer+ListViewDataSource.GetCellForPath (Foundation.NSIndexPath indexPath) [0x00030] in C:\\BuildAgent3\\work\\ca3766cfc22354a1\\Xamarin.Forms.Platform.iOS\\Renderers\\ListViewRenderer.cs:940 \n  at Xamarin.Forms.Platform.iOS.ListViewRenderer+ListViewDataSource.GetCell (UIKit.UITableView tableView, Foundation.NSIndexPath indexPath) [0x00011] in C:\\BuildAgent3\\work\\ca3766cfc22354a1\\Xamarin.Forms.Platform.iOS\\Renderers\\ListViewRenderer.cs:746 \n  at (wrapper managed-to-native) UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)\n  at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Users/builder/data/lanes/5024/152b654a/source/xamarin-macios/src/UIKit/UIApplication.cs:79 \n  at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00038] in /Users/builder/data/lanes/5024/152b654a/source/xamarin-macios/src/UIKit/UIApplication.cs:63 \n  at

I looked at your code and I found this in ListProxy class:
public object this[int index]
		object value;
		if (!TryGetValue(index, out value))
			throw new ArgumentOutOfRangeException("index");

		return value;

Obviously, the problem is not with this method but this way your team wrote code hid the real problem. This situation is crashing my app several times and I believe it is affecting others as well.
Comment 1 Paul DiPietro [MSFT] 2017-09-26 18:44:55 UTC

*** This bug has been marked as a duplicate of bug 59412 ***