I'd like to create an array from range of values within an ArrayList but am getting the error "At least one element in the source array could not be cast down to the destination array type".
Why should the following fail, and what would you do instead?
int[] ints = new int[] { 1, 2, 3 };
ArrayList list = ArrayList.Adapter(ints);
int[] mints = (int[])list.GetRange(0, 2).ToArray(typeof(int));