#2317·reactive

Test CoreDispatcher support better

Author: idg10Created May 19, 2026Updated May 19, 2026
Labels[area] Rx

The various ObserveOn and SubscribeOn methods that use CoreDispatcher are not currently well tested.

This is a challenge because getting a CoreDispatcher typically entails having a main window, which can cause problems trying to run tests on a build agent. Historically we have tended to regard CoreDispatcher as a UWP-ism, and since support for that has long been on the wane in Microsoft's tools, we've not worried too much. However, this dispatcher is also used in WinUI, so it will be used even when using the very latest desktop frameworks. So we need to get better at it.

Ideally we would also add tests for the UWP-specific overloads (which work with the Xaml DependencyObject), because we now support UWP on .NET 9.0+. (Previously we've only supported UAP—the UWP on .NET Native stack.)

This isn't a straightforward matter of adding additional tests. We need to work whether it's event possible to run a CoreDispatcher in a headless environment, and to devise a suitable strategy for how to run tests that need a CoreDispatcher.