HELP: Release versus Debug exception problem

  • Thread starter Thread starter bill
  • Start date Start date
B

bill

I'm trying to implement an app level event handler. For starters I just
wanted to trap the bubbled up exception in my main function and display a
dialog box. It works fine in debug mode but in release mode it pops up a
windows error dialog with a stack trace. How do I configure things to
handle the error the same in debug as it does in release?

try
{
Application.Run(new frmMain());
}
catch (Exception ex)
{
MessageBox.Show( ... )
}

Thanks
-Bill
 
Hi,

Somehow, Somewhere there is an unhandled exception . It will be easily visible when you click the Details button. Just browse the stack trace to a function call which has a line number of the source file... e.g. Typically it may be a out of range index call , say your array is of 5 elements and your call the 7th element.

Shoudl you need more help, please post the stack trace(Detail button). Your queries will be answered faster.

Regards
Vipul Patel
Microsoft India Community Star
 
Not sure what you mean. How can there be an unhandled exception in the code
snippet I posted? That error handler is at the highest level isn't it?
It's supposed to be the catch all.

I'm not interested in what caused the error, the error is in there on
purpose; A throw inside my frmMain. The point is I'm trying to build a high
level handler to deal with otherwise unhandled exceptions.


Vipul Patel said:
Hi,

Somehow, Somewhere there is an unhandled exception . It will be easily
visible when you click the Details button. Just browse the stack trace to a
function call which has a line number of the source file... e.g. Typically
it may be a out of range index call , say your array is of 5 elements and
your call the 7th element.
Shoudl you need more help, please post the stack trace(Detail button).
Your queries will be answered faster.
 
Back
Top