Hi,
I'm using System.Reactive 4.3.1 in .netcoreapp3.1 on Windows 10 x64. I don't quite get, why is System.Reactive showing in both Assemblies and Packages (Dependencies). Also, when I look in deps.json, I can see dependency on System.Reactive 4.3.1 and System.Reactive.Reference 4.3.0.0. I couldn't find anything on the Internet regarding System.Reactive.Reference, can anyone elaborate?
Anyway, what bothers me is, I'm using runtime/additionalProbingPath to move assemblies to common folder used by multiple applications. When debugging using COREHOST_TRACE=1, I can see runtime trying to load system.reactive.reference\4.3.0.0\System.Reactive.dll, for some reason, but even after I satisfy this requirement, I get runtime exception:
*** Exception Text ***
System.TypeLoadException: Could not load type 'System.Reactive.Linq.DispatcherObservable' from assembly 'System.Reactive, Version=4.3.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263'.
The only way I can get it to work is to put System.Reactive.dll next to the application dll/exe.
Can anyone help, or at least, explain, what am I missing? Thanks.
I had this issue as well, at least I was getting the same exception message. I fixed it by adding <UseWPF>true</UseWPF to my projects .csproj and setting the SDK like so: <Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">.
In my case this was coming from a unit test project for a WPF application so the above changes were made to my unit test project.
Closing due to age. Using either .NET 5 or setting UseWPF to true will fix this.
Hi there, I need to load a WPF app from a dotnet core 3.1 console application. And when I set the UseWPF property, the output gets converted to a GUI application which is not acceptable for my requirements. Is there another method for loading these classes related to Applications?
My error is similar but slightly different:
Could not load type 'System.Reactive.Concurrency.DispatcherScheduler' from assembly 'System.Reactive, Version=5.0.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263'.
This is at least the second time i've encountered this error when upgrading to .net 5.
If the above solution in insufficient, then try replacing the method
ObserveOnDispatcher
with
ObserveOn(RxApp.MainThreadScheduler)
where its being used in referenced projects (i.e not the main one).
(Leaving this here as much for myself as anyone else haha)
Most helpful comment
Closing due to age. Using either .NET 5 or setting UseWPF to true will fix this.