Unhandled Exception: System.ArgumentException: Destination array was not long enough?
<p>I have this scheduled task that runs every day on the server, the task was working perfectly for 1 year. After a server change (moved the task to a new server), the task started crashing with this execption:</p>

<pre><code>Unhandled Exception: System.ArgumentException: Destination array was not long enough.
Check destIndex and length, and the array's lower bounds.
at System.Array.Copy(Array sourceArray, Int32 sourceIndex, Array destinationArray,
Int32 destinationIndex, Int32 length, Boolean reliable)
at System.Collections.ArrayList.ToArray()
at Directory.MessageVector.findMessageById(Int32 msgId)
at Directory.Connection.ReaderThread.Run()
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext,  
ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()    
</code></pre>

<p>I looked on the internet for this error but all I found relateed to multithreading, parallel programming and locking mechanisms. BUT my task doesn't use any of that, it does not use parallel programming or locking mechanisms, it a simple task that retrieves data from databases and send emails and it was perfectly running before the server change.</p>

<p>ANY IDEAS ????
thank's.</p>
