Application Migration Threading Problems(URGENT)

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.
 
J

Jon Skeet [C# MVP]

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top