Finding out where unobservedTaskException is thrown: stacktrace is null
问题 I have a large C# appication using third party libraries and somewhere in the application a task is run which is not awaited and throws an exception. So I added an event handler to TaskScheduler.UnobservedTaskException: TaskScheduler.UnobservedTaskException += (sender, args) => { _logger.Error(args.Exception); args.SetObserved(); }; However, when this handler is executed, I get some exception with a stacktrace of null: System.AggregateException: A Task's exception(s) were not observed either