[Mono-dev] SPAM-LOW: Re: Unhandled Exceptions in Mono

Charlie Poole charlie at nunit.com
Tue Aug 7 23:21:18 EDT 2007


Hi Miguel, 

> > It appears that Mono doesn't honor the 
> <legacyUnhandledExceptionPolicy 
> > enabled="1"/> setting in NUnit's config. I process the unhandled 
> > exception but the app closes anyway. This is the same 
> behavior I had 
> > in .NET 2.0 before adding the above setting.
> > 
> > I'm still using 1.2.2 but this would be a good reason for 
> me to move 
> > forward, provided it's fixed.
> 
> I do not think we have added support for that;   Would you 
> mind filing a
> bug report and providing information about that setting, and 
> maybe a pointer to the documentation for it, so we can implement it?

I spoke too soon. This isn't the cause of my bug. I think my exception must
be on the main thread somewhere. I'll look into that.

However, I did write a test program and found that the Mono 2.0 profile does
not behave like MS .NET 2.0 with regard to unhandled exceptions. They (MS)
introduced a breaking change with 2.0 that causes unhandled exceptions on
any thread to terminate the app in most cases. You turn off that change with
the <legacyUnhandledExceptionPolicy> element. I hate this change, but they
do have some good reasons as covered at
http://msdn2.microsoft.com/en-us/library/ms228965.aspx and in this article:
http://msdn.microsoft.com/msdnmag/issues/05/10/Reliability/default.aspx?side
=true

Mono didn't introduce the breaking change in the 2.0 profile. Unhandled
exceptions can be taken care of by an UnhandledExceptionHandler without use
of the <legacyUnhandledExceptionPolicy> element.

Is this by design? Or is it a compatibility bug?

Charlie






More information about the Mono-devel-list mailing list