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

Re: Application Migration Threading Problems(URGENT) by Jon

Jon
Sun Aug 20 00:01:39 CDT 2006

Eduardo Fonseca B. <EduardoFonsecaB@discussions.microsoft.com> wrote:
> 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

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