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

Package System.Reactive.Windows.Threading 5.0.0 is not compatible with net462. #1476

Open
Muhomorik opened this issue Jan 21, 2021 · 5 comments

Comments

@Muhomorik
Copy link

Bug

Hello,

I have a project that targets 4.6.2 and is written in VB.Net and using WPF.
When trying to update RX to the latest version the package System.Reactive.Windows.Threading fails update with error below.

All other Rx packages like System.Reactive itself update without problem.
It is also strange that WinForms app that targets 4.6.2 seems be able to update to the same version.

Which library version?

System.Reactive.Windows.Threading 5.0.0

What are the platform(s), environment(s) and related component version(s)?

WPF, .Net 4.6.2

What is the use case or problem?

Nuget package doesn't target 4.6.2. And fails to install/update.

What is the expected outcome?

Package should install.

What is the actual outcome?

Severity	Code	Description	Project	File	Line	Suppression State
Error	NU1202	Package System.Reactive.Windows.Threading 5.0.0 is not compatible with net462 (.NETFramework,Version=v4.6.2). Package System.Reactive.Windows.Threading 5.0.0 supports:
  - net472 (.NETFramework,Version=v4.7.2)
  - uap10.0.16299 (UAP,Version=v10.0.16299)	WpfApp1

What is the stacktrace of the exception(s) if any?

None.

Do you have a code snippet or project that reproduces the problem?

Problem reproduces with a blank VisualBasic WPF app that targets 4.6.2.

@clairernovotny
Copy link
Member

You should not need that package; those are old shims for compatibility for libraries built against very old versions of Rx. You should just need System.Reactive.

@Muhomorik
Copy link
Author

Hello,

What is the equivalent code for ObserveOnDispatcher?

        Observable
            .Interval(TimeSpan.FromSeconds(5))
            .ObserveOnDispatcher()
            .Subscribe(
                x => { Console.WriteLine("Tick."); });

A lot of samples use that code, but now can't be used.
And classes from .Net 5 changes are not shown in ide.

@clairernovotny
Copy link
Member

These are all in System.Reactive already.

Rx v5 requires .NET 4.7.2 or higher; .NET 4.6.2 is not supported.

The support lifecycle of .NET Framework is here
https://docs.microsoft.com/en-US/lifecycle/faq/dotnet-framework

If you target .NET 5, make sure to use the net5.0-windows10.0.19041 TFM as we require the latest SDK (older versions of Windows can be targeted).

@JiriZidek
Copy link

JiriZidek commented Mar 15, 2021

Rx v5 requires .NET 4.7.2 or higher; .NET 4.6.2 is not supported.

I'd suggest to correct the Readme page to reflect this information:

image

@Muhomorik
Copy link
Author

I think the problem is that latest Visual Studio (16.9.1) designer doesn't recognize net5.0-windows10.0.19041 as a target (but will compile and run).
And net5.0-windows is equivalent to net.5.0-windows7.0

You can't select it in drop-down and when changed in code it will be shows as empty line in drop-down.

TargetFramework_7

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

3 participants