I'm getting an Out of Index Error when adding an Object to a System.Collections.Generic.List
Dim myObj As New MyObject
Dim List As New List(Of MyObject)
List.Add(myObj)
The error message are these (translated from my system language):
"Index out of Matrix indexes"
"Matrix origin wasn't long enough"
"Verify srcIndex, size and inferior limits of the matrix"
Shouldn't .NET automatically resize the size of the List?
I cannot replicate this error. It happenes once in hundrededs of operations.
This is running in threads, but each thread has it's own List.
I've tried a SyncLock on the List but without any effect.
Anyone knows what can be the problem and how to avoid it?