The TaskCompletionSource.SetException method in C# is used to set an exception for a TaskCompletionSource, marking it as faulted. This method takes an exception as a parameter and throws it when the task representing this TaskCompletionSource is awaited or when its ContinueWith or ContinueWithAsync methods are invoked. By setting an exception, it allows for the propagation of an error to the awaiting code or continuation methods, providing information regarding the cause of the error.
C# (CSharp) TaskCompletionSource.SetException - 60 examples found. These are the top rated real world C# (CSharp) examples of TaskCompletionSource.SetException extracted from open source projects. You can rate examples to help us improve the quality of examples.