By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,978 Members | 1,492 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,978 IT Pros & Developers. It's quick & easy.

How to trap error that invokes the Send Error Report To Microsoft?

P: n/a
My C# application trys to access directorycontext during Form loading. Try
and Catch if there is an exception. I then output an error message and then
"this.Close();" to exit the application. But, as my applicaiton closes, the
MS dialog comes up asking to send Error Report to MS.
I tried using ThreadException event code from:

But I'm getting compiling message:
The name ErrorhandlerFrom does not exist in the current context.
This is from the line of code:
// Add the event handler for handling UI thread exceptions to the event.
Application.ThreadException += new
ThreadExceptionEventHandler(ErrorHandlerForm.Form1 _UIThreadException);

How to address that? What is ErrorHandlerForm?

I can't find answer to the ErrorHandlerForm so I tried commenting that line
out and I put a try catch around my code(including Application.Run) in
program.cs. Now the MS Error Report dialog does't come up. Why is that so?
And also, is it OK to put a try-catch around Application.Run? Thank you.
Mar 13 '08 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.