Skip to content

ReactiveUI crashes on initialization in a UWP app #1221

@pingzing

Description

@pingzing

Do you want to request a feature or report a bug?
Bug.

What is the current behavior?
ReactiveUI 7.0 crashes on application start with a TypeInitializationException in UWP apps.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem
Create a new, blank UWP app, and add ReactiveUI 7.0 via NuGet. Add some element to your code in, say, App.xaml that makes use of Reactive UI, like private ReactiveList<string> test = new ReactiveList<string>();.

Observe crash.

What is the expected behavior?
No crashes.

What is the motivation / use case for changing the behavior?
Crashes are bad =)

Which versions of ReactiveUI, and which platform / OS are affected by this issue? Did this work in previous versions of ReativeUI? Please also test with the latest stable and snapshot (http://docs.reactiveui.net/en/contributing/snapshot/index.html) versions.
ReactiveUI 7.0, on Windows 10 Anniversary Update, creating a UWP app. Presumably it worked in previous versions, as I see references to people using it for UWP in 6.5.2.

I see the same issue in the latest snapshot (7.1.0-alpha0003).

Other information (e.g. stacktraces, related issues, suggestions how to fix)

The exception message: Value cannot be null. Parameter name: dispatcher

Here's the stack trace:
Inner Exception:

at System.Reactive.Concurrency.CoreDispatcherScheduler..ctor(CoreDispatcher dispatcher)
at System.Reactive.Concurrency.CoreDispatcherScheduler.get_Current()
at ReactiveUI.PlatformRegistrations.<>c.<Register>b__0_5()
at ReactiveUI.WaitForDispatcherScheduler.attemptToCreateScheduler()
at ReactiveUI.PlatformRegistrations.Register(Action`2 registerFunction)
at ReactiveUI.DependencyResolverMixins.InitializeReactiveUI(IMutableDependencyResolver resolver)
at ReactiveUI.RxApp.<>c.<.cctor>b__0_0()
at Splat.Locator.RegisterResolverCallbackChanged(Action callback)
at ReactiveUI.RxApp..cctor()

Outer Exception:

at ReactiveUI.RxApp.get_MainThreadScheduler()
at ReactiveUI.ReactiveList`1.setupRx(IEnumerable`1 initialContents, Double resetChangeThreshold, IScheduler scheduler)
at ReactiveUI.ReactiveList`1..ctor()
at deleteme_rx_test.App..ctor()
at deleteme_rx_test.Program.<>c.<Main>b__0_0(ApplicationInitializationCallbackParams p)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions