ReactiveUI: getting thread marshaling errors when using with Portable Class Libraries

1

Say you have:

  • Portable Class Library where you have most of your ViewModel code
  • You are using reactive-ui in that class library (and thus have nuget reactiveui-core in there)

What can be the source of thread marshalling errors (e.g. The application called an interface that was marshalled for a different thread. (Exception from HRESULT: 0x8001010E (RPC_E_WRONG_THREAD)))?

multithreading
portable-class-library
reactiveui
asked on Stack Overflow Apr 8, 2014 by Gordon

1 Answer

2

While you have included the nuget package reactiveui-core, perhaps, in your main application, you need to also include the "reactiveui" nuget package. This package can't be used in a PCL, but it must be included in your main application. Without it, the platform specific code that fills RxApp and other platform-specific items in the library will not work. Unfortunately, in reactiveui, this is a silent failure. And you can chase your tail for a few hours before figuring this out. :-)

This was discovered in the reactiveui v6 beta.

answered on Stack Overflow Apr 8, 2014 by Gordon

User contributions licensed under CC BY-SA 3.0