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

[Bug]: WPF targeting issue for net6.0-windows #3728

Closed
aurax opened this issue Feb 8, 2024 · 4 comments
Closed

[Bug]: WPF targeting issue for net6.0-windows #3728

aurax opened this issue Feb 8, 2024 · 4 comments

Comments

@aurax
Copy link

aurax commented Feb 8, 2024

Describe the bug 🐞

Hello,
I can't use the latest few versions of ReactiveUI.WPF because not suitable version is listed in the nuget package.

The "net6.0-windows" target framework name is used in my C# project like this:

<PropertyGroup>
    <OutputType>Library</OutputType>
    <TargetFramework>net6.0-windows</TargetFramework>
</PropertyGroup>

This target framework name prevents updating to the latest version of the ReactiveUI.WPF (19.5.41) because the nuget package provides a list of exact targets (which don't match my settings) like:

<dependencies>
...
  <group targetFramework="net6.0-windows10.0.17763">
    <dependency id="ReactiveUI" version="19.5.31" exclude="Build,Analyzers" />
  </group>
  <group targetFramework="net6.0-windows10.0.19041">
    <dependency id="ReactiveUI" version="19.5.31" exclude="Build,Analyzers" />
  </group>
...
</dependencies>

Reproduction repository

https://github.com/reactiveui/ReactiveUI

Expected behavior

I think the dependencies should use a common target version or could you please add the target name "net6.0-windows".

Screenshots 🖼️

image

IDE

Visual Studio 2022

Operating system

Windows

Version

11

Device

No response

ReactiveUI Version

19.5.41

Additional information ℹ️

Restoring packages for C:\work\projects\abc.csproj...
  GET https://api.nuget.org/v3/vulnerabilities/index.json
  OK https://api.nuget.org/v3/vulnerabilities/index.json 74ms
  GET https://api.nuget.org/v3-vulnerabilities/2024.02.06.05.41.26/vulnerability.base.json
  GET https://api.nuget.org/v3-vulnerabilities/2024.02.06.05.41.26/2024.02.08.05.41.44/vulnerability.update.json
  OK https://api.nuget.org/v3-vulnerabilities/2024.02.06.05.41.26/vulnerability.base.json 19ms
  OK https://api.nuget.org/v3-vulnerabilities/2024.02.06.05.41.26/2024.02.08.05.41.44/vulnerability.update.json 68ms
NU1701: Warning As Error: Package 'ReactiveUI.WPF 19.5.41' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8, .NETFramework,Version=v4.8.1' instead of the project target framework 'net6.0-windows7.0'. This package may not be fully compatible with your project.
Package restore failed. Rolling back package changes for 'abc'.
Time Elapsed: 00:00:00.4501848
========== Finished ==========
@aurax aurax added the bug label Feb 8, 2024
@dpvreony dpvreony removed the bug label Feb 8, 2024
@dpvreony
Copy link
Member

dpvreony commented Feb 8, 2024

this is due to dependencies in System.Reactive along with the default targeting of netX-windows being windows 7 which is unsupported

the recommendation is to target net6.0-windows10.0.19041

@dpvreony dpvreony closed this as completed Feb 8, 2024
@dpvreony dpvreony changed the title [Bug]: [Bug]: WPF targeting issue for net6.0-windows Feb 8, 2024
@aurax
Copy link
Author

aurax commented Feb 10, 2024

this is due to dependencies in System.Reactive along with the default targeting of netX-windows being windows 7 which is unsupported

the recommendation is to target net6.0-windows10.0.19041

Strange...
please, check, for example, the "Microsoft.VisualStudio.Threading" NuGet package references. They supports net6.0-windows7.0 target.

<dependencies>
    <group targetFramework=".NETFramework4.7.2">...</group>
    <group targetFramework="net6.0">...</group>
    <group targetFramework="net6.0-windows7.0">...</group>
    <group targetFramework=".NETStandard2.0">...</group>
</dependencies>

@ChrisPulman
Copy link
Member

If you were to purely add System.Reactive to a WPF Application with a net8.0-windows TFM you will find yourself with a net462 version of the assembly trying to be added to your project, due to some conflicts this will then lead to incorrect System.Reactive elements being used in your application, ultimately leading to instabilities within your application.
ReactiveUI.WPF has a dependency on System.Reactive and hence we must use their minimum supported windows version in order to have full support for the underlying functions.
We strongly recommend that you follow these guidelines to ensure optimum performance and support. You should always base your minimum on the newest supported windows version within the dependencies included in your application.
Different TFM's have differences in the functionality included, often a newer TFM will be selected to make use of a particular feature.
I hope that you can understand this, many thanks and we hope that you can enjoy using ReactiveUI for your projects.

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants