Reason for Application.ThreadExit

  • Thread starter Thread starter pavel.orehov
  • Start date Start date
P

pavel.orehov

Hi,

We have the strange problem that sometime in our application
Application.ThreadExit is raised and out application shutting down.

We do not see any previous exceptions before this event fires.

Moreover the Application.ThreadException event is not fired at all, so
we have not unhandled exceptions that occurs.

We are working with SQL-2005 and with some unmanaged code too.

What can be the reason for such behaviour ? And how can we catch such
error ?

Thanks,
Pavel
 
Hi,

How do you know the exception is occuring if you cannot catch it? Are you
receiving a dialog? What version of the framework are you using? Are you
aware that unhandled exceptions wont be caught in debug mode? Why do you
include sql 2005 plus unmanaged in your problem? Does the problem occur when
accessing code paths involving these services or is it just totally random?

Richard
 
How do you know the exception is occuring if you cannot catch it?

I am registering to Application.ThreadExit &
Application.ThreadException. The ThreadExit fires without
ThreadException. I am not sure this was exception, but why ThreadExit
fires ?
Are you receiving a dialog?
No

What version of the framework are you using?
3.0

Are you aware that unhandled exceptions wont be caught in debug mode?

I know, but the problem that there are no exceptions, just thread exit.
Why do you include sql 2005 plus unmanaged in your problem? Does the problem occur when
accessing code paths involving these services or is it just totally
random?

Random.

My main question is what can cause to main thread of Windows Forms
raise ThreadExit without rasing ThreadException before ?
 
ThreadExit just means the thread is shutting down, usually due to the
application ending. The ExitThread method would cause this to be
raised, as well as the last form closing.
 
Back
Top