What is the exception that makes to throw a Task.ThrowIfExceptional?

What happens when you execute an action returning a Task is that any exceptions get stored in the task's Task.Exception property.

When you call Wait, the code waits for the task to finish and then re-throws any exceptions that have occurred inside an AggreagtedException. So the ThrowIfExceptional method is being called after the task has finished to raise any exceptions that have occurred.

So likely the problem is a null reference in whatever code got executed to return the task being waited on. Should be something inside:

 MyCompany.Dispositivos.Plugins.TICAnKorr.DeviceTICAnKorr.StopLive()

Tags:

C#

Exception

Task