UnobservedTaskException Event

Task Parallel System.Threading

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:  System.Threading (in System.Threading.dll)

Syntax

Visual Basic (Declaration)
Public Shared Event UnobservedTaskException As EventHandler(Of UnobservedTaskExceptionEventArgs)
C#
public static event EventHandler<UnobservedTaskExceptionEventArgs> UnobservedTaskException

Remarks

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.

See Also