diff --git a/src/ReactiveUI/RxApp.cs b/src/ReactiveUI/RxApp.cs index 988d595f9..49e880989 100644 --- a/src/ReactiveUI/RxApp.cs +++ b/src/ReactiveUI/RxApp.cs @@ -107,6 +107,7 @@ static RxApp() }); }); + _suspensionHost = new SuspensionHost(); if (ModeDetector.InUnitTestRunner()) { LogHost.Default.Warn("*** Detected Unit Test Runner, setting MainThreadScheduler to CurrentThread ***"); @@ -124,8 +125,6 @@ static RxApp() { _mainThreadScheduler = DefaultScheduler.Instance; } - - SuspensionHost = new SuspensionHost(); } /// @@ -202,12 +201,7 @@ public static IObserver DefaultExceptionHandler /// public static ISuspensionHost SuspensionHost { - get - { - var host = _unitTestSuspensionHost ?? _suspensionHost; - return host; - } - + get => _unitTestSuspensionHost ?? _suspensionHost; set { if (ModeDetector.InUnitTestRunner())