<PackageReference Include="Microsoft.Bcl" Version="1.1.8" />

System.Threading.Tasks.UnobservedTaskExceptionEventArgs

Provides data for the event that is raised when a faulted Task's exception goes unobserved.
public AggregateException Exception { get; }

The Exception that went unobserved.

public bool Observed { get; }

Gets whether this exception has been marked as "observed."

Initializes a new instance of the UnobservedTaskExceptionEventArgs class with the unobserved exception.

public void SetObserved()

Marks the Exception as "observed," thus preventing it from triggering exception escalation policy which, by default, terminates the process.