From 8cfa7be4f22fd6f4fa3200a43f6aeeae849326e7 Mon Sep 17 00:00:00 2001 From: jasontaylordev Date: Wed, 27 May 2026 14:29:59 +1000 Subject: [PATCH] Revert: Update dependency ReactiveUI.WPF to v23 (#5328) --- src/Directory.Packages.props | 2 +- src/ServiceControl.Config/AppBootstrapper.cs | 18 ++++++++---------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props index e99461249b..88e89380ce 100644 --- a/src/Directory.Packages.props +++ b/src/Directory.Packages.props @@ -70,7 +70,7 @@ - + diff --git a/src/ServiceControl.Config/AppBootstrapper.cs b/src/ServiceControl.Config/AppBootstrapper.cs index b3a0554f0a..4b8d0d19c6 100644 --- a/src/ServiceControl.Config/AppBootstrapper.cs +++ b/src/ServiceControl.Config/AppBootstrapper.cs @@ -11,7 +11,6 @@ using Caliburn.Micro; using FluentValidation; using ReactiveUI; - using ReactiveUI.Builder; using ServiceControl.Config.Framework; using ServiceControlInstaller.Engine.Validation; using UI.Shell; @@ -42,18 +41,17 @@ protected override void Configure() DisableRxUIDebuggerBreak(); } - // ReactiveUI's default handler calls Debugger.Break() on unhandled reactive exceptions, which pauses at an unhelpful - // internal location. This replaces it so exceptions are re-thrown on the main thread with a useful stack trace instead. void DisableRxUIDebuggerBreak() { - _ = RxAppBuilder.CreateReactiveUIBuilder() - .WithExceptionHandler(Observer.Create(delegate (Exception ex) + RxApp.DefaultExceptionHandler = Observer.Create(delegate (Exception ex) + { + RxApp.MainThreadScheduler.Schedule(() => { - _ = RxSchedulers.MainThreadScheduler.Schedule(() => throw new Exception( - "An OnError occurred on an object (usually ObservableAsPropertyHelper) that would break a binding or command. To prevent this, Subscribe to the ThrownExceptions property of your objects", - ex)); - })) - .BuildApp(); + throw new Exception( + "An OnError occurred on an object (usually ObservableAsPropertyHelper) that would break a binding or command. To prevent this, Subscribe to the ThrownExceptions property of your objects", + ex); + }); + }); } protected override object GetInstance(Type service, string key)