HELP: Release versus Debug exception problem

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
 
G

Guest

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
 
N

new.microsoft.com

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.
 

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