UnobservedTaskException Event
Collapse the table of content
Expand the table of content

TaskScheduler.UnobservedTaskException Event

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Occurs when a faulted Task's unobserved exception is about to trigger exception escalation policy, which, by default, would terminate the process.

Namespace:  System.Threading.Tasks
Assembly:  mscorlib (in mscorlib.dll)

public static event EventHandler<UnobservedTaskExceptionEventArgs> UnobservedTaskException

This AppDomain-wide event provides a mechanism to prevent exception escalation policy (which, by default, terminates the process) from triggering.

Each handler is passed a UnobservedTaskExceptionEventArgs instance, which may be used to examine the exception and to mark it as observed.

Windows Phone OS

Supported in: 8.1, 8.0

© 2017 Microsoft