Dispatcher.Invoke not working in .NET 3.0 SP1

Posted by Kapil on Stack Overflow See other posts from Stack Overflow or by Kapil
Published on 2010-05-24T11:53:50Z Indexed on 2010/05/24 12:01 UTC
Read the original article Hit count: 490

Filed under:
|

I am developing a WPF windows application and am getting into a trouble running the app in .NET 3.0. Everytime that I try to access the System.Windows.Threading.Dispatcher.Invoke() method, I get a method-not-found error.

Basically, I spawn a new thread from the main thread and try to change some UI properties (basically update a progress-bar) from the new thread using the following code:

updateStatusDelegate usd = new updateStatusDelegate(progressBar.SetValue);
Dispatcher.Invoke(usd, System.Windows.Threading.DispatcherPriority.Background, new object[] { System.Windows.Controls.ProgressBar.ValueProperty, Convert.ToDouble(perc) });

Can someone help me understand why do I encounter this error in .NET 3.0 version? I am able to get this going in .NET 3.0 SP2. But I guess .NET is not distributed independantly and is packaged only with .NET 3.5 version. My goal is to get away with the dependancy of .net 3.5 and have a dependancy on .NET 3.0 version

Any help would be appreciated.

Thanks

Kapil

© Stack Overflow or respective owner

Related posts about c#

Related posts about .net-3.0