Skip to content

Rx.NET 6 preview 1 does not work with net7.0-windows #1889

@JasonWeinzierl

Description

@JasonWeinzierl

When installing System.Reactive version 6.0.0-preview.1 either to a project that targets net7.0-windows or to a class library that's referenced by another project targeting net7.0-windows, I get the following error:

The 'System.Reactive' nuget package cannot be used to target 'net7.0-windows'. Target 'net6.0-windows10.0
.19041' or later instead.

Which library version?

6.0.0-preview.1

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

Windows 10 22H2 19045.2673

dotnet CLI version 7.0.201

What is the use case or problem?

Applications with an OS-specific TFM (like a windows desktop app)

What is the expected outcome?

.NET 7 apps with an OS-specific TFM using Rx 6 should build successfully

What is the actual outcome?

Build fails

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

MSBuild version 17.5.0-preview-23061-01+040e2a90e for .NET
  Determining projects to restore...
  All projects are up-to-date for restore.
C:\Users\{redacted}\.nuget\packages\system.reactive\6.0.0-preview.1\buildTransitive\net6.0-windows7\System.Reactive.targets(
5,5): error : The 'System.Reactive' nuget package cannot be used to target 'net7.0-windows'. Target 'net6.0-windows10.0
.19041' or later instead. [{redacted}\TestRx6Win7\TestRx6Win7.csproj]

Build FAILED.

C:\Users\{redacted}\.nuget\packages\system.reactive\6.0.0-preview.1\buildTransitive\net6.0-windows7\System.Reactive.targets(
5,5): error : The 'System.Reactive' nuget package cannot be used to target 'net7.0-windows'. Target 'net6.0-windows10.0
.19041' or later instead. [{redacted}\TestRx6Win7\TestRx6Win7.csproj]
    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:00.60

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

Set up a new console app (using --target-framework-override for the sake of example but the same occurs if you manually change the TFM via Visual Studio or editing the csproj):

dotnet new console -n TestRx6Win7 --target-framework-override net7.0-windows
cd .\TestRx6Win7
dotnet run

Then install Rx 6 preview 1:

dotnet add package System.Reactive -v 6.0.0-preview.1
dotnet build

Build fails with the aforementioned error.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions