How to catch an exception ocurred in the work thread from the main thread?

K

Kueushiong Tu

I have a window form application. The main thread creates
a work thread to do a web request. The work thread has the
exception mechanism in place so that if there is anything
wrong with the web request, the exception is catched in
the work thread. However it still causes the main thread
to crash. The debugger output says an
'System.ExecutionEngineException' exception ocurred in
the unknown module is not catched.
How do I catch an exception occurred in the work thread
from the main thread to prevent the application from
being crashed?
 
J

Joerg Jooss

Kueushiong Tu said:
I have a window form application. The main thread creates
a work thread to do a web request. The work thread has the
exception mechanism in place so that if there is anything
wrong with the web request, the exception is catched in
the work thread. However it still causes the main thread
to crash. The debugger output says an
'System.ExecutionEngineException' exception ocurred in
the unknown module is not catched.
How do I catch an exception occurred in the work thread
from the main thread to prevent the application from
being crashed?z

ExecutionEngineException is quite severe. Can you describe the screnario
in more detail or post some code?

Cheers,
 

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