Subject: Create MailMessages in Parallel.ForEach
Date: 2010-07-30 15:25:03
From: Christian Jursik
Source: create-mailmessages-parallel-foreach
----------------------------------------------------------------------

Hi!

I thought it would implement a dictionary because of the line "System.Collections.Generic.Dictionary`2.Insert" in the stacktrace.
There cant be a duplicate address in from or to because both have only one address. i think, the problem isnt linq but the fact that parallel.foreach uses 2 or more threads parallel (depending on how many cpus or cpu-cores exist on the machine).
What i could see is that when i remove the adding of the from-address (which is the same for each mail but only added once for each mail) i dont get an error.

Christian ---------------------------------------------------------------------- Note: This question has been asked on the Q&A forum of Thang Dang's fraudulent ComponentPro brand If you purchased anything from ComponentPro, you have been scammed. Contact the payment processor who sold you the license and ask for your money back. Back to ComponentPro Q&A Forum Index