global exception handling not working - threads?
tpatke
Posts: 10 Bronze 2
I am using SmartAssembly v.5. ...trying to anyway. :-)
My smartassembly build is not catching unhandled exceptions. Instead, I am getting the standard "Details, Continue, Quit" dialog. I have never had a problem with SmartAssembly catching exceptions before (version 4). Maybe the issue has something to do with the code running on a thread which is not setup to act as a global error handler? The error is being generated on the main GUI thread in main form's KeyDown event.
If I were to delete a dll from the application directory, I would get an error on startup which does show the SmartAssembly global error handler.
Any ideas?
Thanks in advance,
Toby
My smartassembly build is not catching unhandled exceptions. Instead, I am getting the standard "Details, Continue, Quit" dialog. I have never had a problem with SmartAssembly catching exceptions before (version 4). Maybe the issue has something to do with the code running on a thread which is not setup to act as a global error handler? The error is being generated on the main GUI thread in main form's KeyDown event.
If I were to delete a dll from the application directory, I would get an error on startup which does show the SmartAssembly global error handler.
Any ideas?
Thanks in advance,
Toby
Comments
If I bypass the login, SmartAssembly seems to work fine. If I login, I get the error described above.
Any ideas?
Cheers,
Toby
Cheers,
Toby
When the login form closes, the last part of the Application.Run(...) call performs various operations that clear-up the application's context. These contexts include the application's ThreadContext, this means the event handler for unhandled exceptions in the thread is removed, stopping the Unhandled Exception feature for being called.
The better method if you want to have multiple forms displayed is to do Application.Run on the main form, and possibly set it to be hidden in the constructor.
Then within the main form's load method show the other form.