c# - What causes the UnhandledExceptionEventArgs.IsTerminating flag to be true or false? -
when subscribed events on appdomain.currentdomain.unhandledexception
criteria causes unhandledexceptioneventargs
isterminating
flag true? i.e. causes exception considered fatal?
is case default unhandled exceptions fatal unless configured otherwise?
this property true. used possible false, way in .net 1.x days. version allowed thread die on unhandled exception without having entire process terminate. didn't work out well, programmers didn't implement event handler (or didn't know how handle exception event, does) threads died without notice whatsoever. impossible not have cause difficult diagnose program failure.
microsoft changed default behavior in .net 2.0, unhandled exception terminates program. technically still possible override behavior, custom clr host can keep process alive implementing ihostpolicymanager interface. , default host supports <legacyunhandledexceptionpolicy>
config element. don't use it, way lies dragons.
Comments
Post a Comment