Application Migration Threading Problems(URGENT)

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an application originally built in .NET Framework 1.1, it is a Windows
Forms,
the application runs ok with the .NET 1.1, but I'm in hte process of
migrating it to .NET 2.0, but I´ve found a problem with it.
The case is that I'm getting an exception n every single thread I have,
this is the exception message

"Cross-thread operation not valid: Control 'frmPrincipal' accessed from a
thread other than the thread it was created on."

It happens only with .NET 2.0.
 
Eduardo Fonseca B. said:
I have an application originally built in .NET Framework 1.1, it is a Windows
Forms,
the application runs ok with the .NET 1.1, but I'm in hte process of
migrating it to .NET 2.0, but I?ve found a problem with it.
The case is that I'm getting an exception n every single thread I have,
this is the exception message

"Cross-thread operation not valid: Control 'frmPrincipal' accessed from a
thread other than the thread it was created on."

It happens only with .NET 2.0.

You have a bug in your code - it's just that .NET 2.0 alerts you to
this bug and .NET 1.1 didn't, it just wouldn't work sometimes.

See http://www.pobox.com/~skeet/csharp/threads/winforms.shtml
 
Back
Top