I am getting a wierd result in my code sporadically. First of all, I am using an old VB .NET client dll which uses a Microsoft.VisualBasic.Collection, ugh! When I loop through the collection in my C# code, I occasionally get an exception.
the code ..
foreach (Tag tag in object.Tags)
{
...
}
sometimes I get an IndexOutOfRange, sometimes a NullReference, the code is invoked by a thread timer. Is it that the Collection isn't thread safe? It runs fine on my XP development machine, but not on the Windows Server 2003R2 server. I dont get it.
Any ideas?
IndexOutOfRange Exception on foreach loop
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Scott LysleRank #49 · 31K reputationPosted Jun 25, 2008, 6:43 PM EDT
Bill3 reputationPosted Jun 26, 2008, 4:16 AM EDT