问题
I am developing a client/server application as part of my dissertation and have chosen to use SocketAsyncEventArgs
to get the maximum amount of performance in terms of network operations. This afternoon I decided to run a quick and dirty stress test of the application creating 20 threads and sending 100,000 UDP messages per thread. Near the end of the application the following exception:

How do I go about finding the cause of the exception? Or does any body have an idea why it's falling over at a seemingly random place?
I can re-produce most of the time I believe and am happy to provide code if necessary.
Update:
I have run the exact same code on .Net version 4.0 without error. It seems to be an issue with .Net 4.5/Compliers/Jit as far as I can tell. Any ideas on how to narrow down the exception would be greatly appreciated.
回答1:
Does it only occur when debugging? I have seen a similar case, where I would get these errors only when debugging x86(not any type) on x86.
来源:https://stackoverflow.com/questions/14789628/fatalexecutionengineerror-detected-when-unhooking-event