Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
UnobservedTaskExceptionEventArgs Class

UnobservedTaskExceptionEventArgs Class

Provides data for the event that is raised when a faulted Task's exception goes unobserved.

System.Object
  System.EventArgs
    System.Threading.Tasks.UnobservedTaskExceptionEventArgs

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

public class UnobservedTaskExceptionEventArgs : EventArgs

The UnobservedTaskExceptionEventArgs type exposes the following members.

  NameDescription
Public methodSupported by Portable Class LibraryUnobservedTaskExceptionEventArgsInitializes a new instance of the UnobservedTaskExceptionEventArgs class with the unobserved exception.
Top

  NameDescription
Public propertySupported by Portable Class LibraryExceptionThe Exception that went unobserved.
Public propertySupported by Portable Class LibraryObservedGets whether this exception has been marked as "observed."
Top

  NameDescription
Public methodSupported by Portable Class LibraryEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected methodSupported by Portable Class LibraryFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodSupported by Portable Class LibraryGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodSupported by Portable Class LibraryGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodSupported by Portable Class LibraryMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodSupported by Portable Class LibrarySetObservedMarks the Exception as "observed," thus preventing it from triggering exception escalation policy which, by default, terminates the process.
Public methodSupported by Portable Class LibraryToStringReturns a string that represents the current object. (Inherited from Object.)
Top

The Exception property is used to examine the exception without marking it as observed, whereas the SetObserved method is used to mark the exception as observed. Marking the exception as observed prevents it from triggering exception escalation policy which, by default, terminates the process.

.NET Framework

Supported in: 4.6, 4.5, 4

.NET Framework Client Profile

Supported in: 4

.NET for Windows Phone apps

Supported in: Windows Phone 8.1, Windows Phone Silverlight 8.1, Windows Phone Silverlight 8

Portable Class Library

Supported in: Portable Class Library

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2015 Microsoft