Hi!

I am currently troubleshooting an old compact framework application. The users complain that sometimes they get this annoying unhandled exception native dialog box when there is something wrong in the application, instead of a custom "an error occured" messagebox that someone implemented and is supposed to catch all exceptions, and hsow a friendly message. The app itself is rather simple, just showing some data in lists.

Now, I looked into the issue, and it seems like 1 year ago someone replaced some sync calls to a WCF webservice with async calls, using Begin... and End... methods.

Apparently, when an exception occurs in this async method, mostl likely due to error in communicating with the web service, a webexception is throw, which is causing the thread to abort, and a threadabortexception to occur. This threadabortexception is the caught in the "main" try/catch, but then it rethrows itself causing an unhandled exception message which is displayed on top of the generic error message box.

How can I handle this? One common way is to wrap the async calls with a try-catch(threadabortexception) and then do a Thread.ResetAbort(), but this method does not exist in the compact framework? Any other options?

cheers
Henrik