Here's an interesting one: in VS2005 / VS2008, working with .NET 2.0 / .NET 3.0 / .NET 3.5, the BackgroundWorker stream cannot directly update controls in the form of WinForms that initiated this stream - you will get System.InvalidOperationExceptionfrom BackgroundWorker, which indicates that the operation Cross-thread is not valid: Control 'thecontrol' accessed from a thread other than the one that was created on. "I remember how it happened in 2004 or so when I first started writing .NET WinForms applications with There are several ways to solve this problem - this is not a question requiring an answer .
I was recently informed that such an operation is now permitted when it is written in VS2010 / .NET 4.0. This seems unlikely to me, since such restriction of access to objects has always been a rather important part of thread-safe programming. Allowing the BackgroundWorker stream direct access to objects that do not belong on their own, but in the form of its parent interface, contradicts this principle. Thrall through .NET 4.0 documents did not reveal any obvious changes that could explain this behavior.
I don't have VS2010 / .NET 4.0 to test this - is there anyone who has access to this toolkit that knows for sure whether the model has changed to allow this kind of thread interaction? I would like to use it in the future, or deploy a clause .;)
source
share