/// <summary> /// Register exception handling synchronization context to app domain. /// </summary> private void RegisterExceptionHandlingSynchronizationContext() { ExceptionHandlingSynchronizationContext .Register() .UnhandledException += OnAsyncUnhandledException; }