Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ObserveOnDispatcher is not available in a .NET 5 WPF app #1466

Closed
twtdev opened this issue Jan 8, 2021 · 1 comment
Closed

ObserveOnDispatcher is not available in a .NET 5 WPF app #1466

twtdev opened this issue Jan 8, 2021 · 1 comment

Comments

@twtdev
Copy link

twtdev commented Jan 8, 2021

Library/environment:
System.Reactive 5.0.0
.NET 5 (WPF)
Windows version 10.0.19042
Visual Studio version 16.8.3

What is the use case or problem?
Create a brand new project using the WPF App (.NET) template, change the target framework to .NET 5.0 in the project's properties page, add the System.Reactive 5.0.0 nuget package. Then in MainWindow.xaml.cs, add the following code to MainWindow():

IObservable<string> singleValue = Observable.Return<string>("Value");
singleValue.ObserveOnDispatcher();

What is the expected outcome?
That there would be no errors.

What is the actual outcome?
A compile-time error: IObservable does not contain a definition for 'ObserveOnDispatcher'...

Do you have a code snippet or project that reproduces the problem?
Yes, can be provided if required, but probably faster just to try the steps described above

Also, my .csproj file contains the following:

<PropertyGroup>
  <OutputType>WinExe</OutputType>
  <TargetFramework>net5.0-windows</TargetFramework>
  <UseWPF>true</UseWPF>
</PropertyGroup>
@twtdev
Copy link
Author

twtdev commented Jan 12, 2021

Solved: I changed the TargetFramework value to net5.0-windows10.0.19041

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant