I have upgraded a multi-threaded C# app from VS2003 (CLR 1.1) to VS2005
(CLR 2.0) and it's hopeless (Event Id 5000). I believe there is a
switch somewhere that will allow me to revert the threading model to
1.1. I could use this to prove that the issue is threading. Can
anyone tell me how to set this switch, please?
thanks,
Hanna.
Jon Skeet [C# MVP] - 03 Jan 2007 21:39 GMT
> I have upgraded a multi-threaded C# app from VS2003 (CLR 1.1) to VS2005
> (CLR 2.0) and it's hopeless (Event Id 5000). I believe there is a
> switch somewhere that will allow me to revert the threading model to
> 1.1. I could use this to prove that the issue is threading. Can
> anyone tell me how to set this switch, please?
What do you think the difference in threading model between 1.1 and 2.0
is?

Signature
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Günter Prossliner - 04 Jan 2007 09:39 GMT
Hi Hanna!
> I have upgraded a multi-threaded C# app from VS2003 (CLR 1.1) to
> VS2005 (CLR 2.0) and it's hopeless (Event Id 5000). I believe there
> is a switch somewhere that will allow me to revert the threading
> model to 1.1.
Do you meen Control.CheckForIllegalCrossThreadCalls? This is a static
property. If you set it to false, no Exceptions will be thrown when you are
accessing a Control from a Thread which have not created it.
> I could use this to prove that the issue is threading.
You are aware that IMO the 1.1 Behaviour is a bug. Cross-Thread Operation
where never allowed in Windows when Window-Handles are involved. If MAY work
sometimes, but it is not reliable.
You sould use .InvokeRequired / .Invoke for cross-thread operations within
Windows Forms.
GP