Peter Himschoot's Windows Foundation Trilogy

Talking about .NET, Windows Presentation Foundation, Workflow Foundation and Communication Foundation

U2U provides .NET development training, coaching and consultancy services. We are based in Brussels but active in Europe, Middle-East and Africa. If you are interested in our course calendar or want to organize an on-site training, have a look at our Web site - www.u2u.net

My Links

News

Peter Himschoot
E-mail: peter@u2u.net
Mobile: +32 475 970084

Post Categories

Archives

Blog Stats

Background processing in .NET 2.0 ctd.

Regarding my article on background processing, someone noted that the exception thrown by my code actually stops at the exception with the "Error not handled by user's code" message. I think this is a bug in beta 2, because documentation clearly states (from MSDN))

<BackgroundWorker object will catch the exception and pass it into the RunWorkerCompleted event handler, where it is exposed as the RunWorkerCompletedEventArgs.Error property. >>

Workaround (see MSDN): Catch exceptions in your DoWork event handler, and return the exception as the result instread of the normal result. Then check the result in your RunWorkCompleted handler.

Another note came from Martijn Sipkema about the fact that I use the IsCancelling boolean without locking it. Again MSDN documentation gives the answer:

<

This type is safe for multithreaded operations.>>

I interpret this that changing a boolean's value is atomic, therefore thread-safe.

posted on Sunday, August 07, 2005 11:33 PM

Feedback

# re: Background processing in .NET 2.0 ctd. 9/16/2005 5:15 AM eeevans

What is .NET 2.0 ctd? I know CTP for community technology preview but not ctd. Also, have you tried your backgroundworker code in RC1?

# re: Background processing in .NET 2.0 ctd. 12/5/2006 9:21 AM 窃听器

good~

Title  
Name  
Url
Comments   
Protected by Clearscreen.SharpHIPEnter the code you see: