Re: CLR Exceptions not getting handled in try/catch
- From: Mike Treadway <MikeTreadway@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 4 May 2006 15:35:01 -0700
Yeah, I put that code snippet on someone else's machine and built it. When I
ran it on their machine, it displayed a message box with the error (as we
would expect, our application caught the exception and displayed our own
message box with the error). When I copied that binary file to my machine and
ran it, I got the "Send to Microsoft" message.
It's got to be an environment issue. I've also tried uninstalling and
reinstalling the .NET Framework 1.1
"Göran Andersson" wrote:
Have you tried to compile the code on your machine and run it on some.
other, or compiled it on some other and run it on your? That would
determine if the code gets compiled differently or if it's just a
difference in how exceptions are handled.
Mike Treadway wrote:
Thanks again for your reply.
The problem I'm having is something with either my .NET Framework
configuration, or with my computer configuration. The other developers on my
team don't have the problem. I've tried reinstalling/reparing Visual Studio
.NET and that didn't do anything but burn up an hour.
When an exception is thrown by the CLR, what decides how that information is
shown to the user? All of my customers and other developers see the typical
Unhandled Exception dialog that gives them the option of continuing or
exiting. My machine is showing the "Send information to Microsoft" dialog.
What setting on my machine decides which dialog to display? I've compare the
aedebug registry folder and other .NET debug registry folders to another
installation of VS.NET and they are identical.
Mike
"Göran Andersson" wrote:
When I test your code I can't reproduce the problem.
It's hard to guess what the cause might be without seeing the actual
code that has the problem.
Mike Treadway wrote:
Thanks for the reply.
I should have stated that the code snippet I provided was something I had
quickly written to reproduce the issue and to demonstrate what was happening
for this post.
Any other ideas?
"Göran Andersson" wrote:
It might be that the code gets optimized, as the value is constant, and
the optimization causes unrunnable code. Try it with a more real situation:
object o = null;
try {
string buf = o.ToString();
} catch(Exception e) {
MessageBox.Show(e.Message);
}
Mike Treadway wrote:
I've got a managed application that (on my computer) is not handling managed
exceptions. I've got the following:
try
{
string buf = (null as object).ToString();
}
catch(Exception e)
{
MessageBox.Show(e.Message);
}
When I run the application and perform the UI event that runs the above
code, I get the Microsoft Error Reporting dialog that asks me if I want to
send the information to microsoft. The uncaught exception reporting by the
tool is 0x80000003.
I would expect the Unhandled Exception dialog box to appear letting me
choose to continue or exit. Also, if I put a try/catch around throw new
NullReferenceException(), it works just fine.
Any ideas?
Mike
- Follow-Ups:
- Re: CLR Exceptions not getting handled in try/catch
- From: Oleg Starodumov
- Re: CLR Exceptions not getting handled in try/catch
- References:
- Re: CLR Exceptions not getting handled in try/catch
- From: Göran Andersson
- Re: CLR Exceptions not getting handled in try/catch
- From: Göran Andersson
- Re: CLR Exceptions not getting handled in try/catch
- From: Mike Treadway
- Re: CLR Exceptions not getting handled in try/catch
- From: Göran Andersson
- Re: CLR Exceptions not getting handled in try/catch
- Prev by Date: Re: Memory leak when using OleDb
- Next by Date: Re: Not logging in application log
- Previous by thread: Re: CLR Exceptions not getting handled in try/catch
- Next by thread: Re: CLR Exceptions not getting handled in try/catch
- Index(es):
Relevant Pages
|
Loading