
exception on form.show (vb.Net windows forms)
--------------------
| Content-Class: urn:content-classes:message
| Subject: exception on form.show (vb.Net windows forms)
| Date: Tue, 8 Apr 2003 01:28:17 -0700
|
| I have a problem where an exception thrown by the form
| Load event is causing an unhandled exception, even though
| the code calling the form has exception handling.
|
| The wierdest thing is that is only happens in the released
| runtime, and not when I am running the development
| environment in debug mode.
|
| We were originally using our own exception class,
| inheriting System.ApplicationException, but I have also
| tried throwing a standard System.Exception with the same
| result.
|
| The unhandled exception is not very specific and occurs
| when the exception is thrown, but before the thrown
| exception reaches the calling code. The unhandled
| exception is then caught by the exception handling in
| Function ShowForm (code shown at end of posting).
[code snipped]
Two things appear to me right away:
1) I don't see ShowForm anywhere in the callstack you gave with the
exception. This could mean that you're not reaching the try/catch block
that you pasted. When the exception hits, try browsing through the
Callstack window to see if you can be certain that it's passing through the
code you gave.
2) "Already locked" sounds like a concurrency issue to me. If your program
is threaded, and the exception is being thrown in a different thread than
the catcher, you're not going to catch it, even if the new thread is
created inside a try/catch block.
- Matt
MS VB QA