reactiveui / ReactiveUI

An advanced, composable, functional reactive model-view-viewmodel framework for all .NET platforms that is inspired by functional reactive programming. ReactiveUI allows you to abstract mutable state away from your user interfaces, express the idea around a feature in one readable place and improve the testability of your application.
https://www.reactiveui.net
MIT License
8.11k stars 1.12k forks source link

[Bug]: Wrong Nuget Version #3931

Closed GerdWB closed 2 weeks ago

GerdWB commented 2 weeks ago

Describe the bug 🐞

When creating a new .Net 6 Wpf Application and after adding NuGet Package ReactiveUI.WPF 20.1.63 I get the Compiler Warning: warning NU1701: Package 'ReactiveUI.WPF 20.1.63' 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.

Step to reproduce

  1. Create a new .Net6 WPF Application in VisualStudio 2022
  2. Add NuGet Package ReactiveUI.WPF 20.1.63
  3. Compile
  4. Check Output window for warnings

Reproduction repository

https://github.com/reactiveui/ReactiveUI

Expected behavior

The correct .Nuget Package ReactiveUI.WPF 20.1.63 for .Net 6 should be installed

Screenshots 🖼️

No response

IDE

Visual Studio 2022

Operating system

Windows 11

Version

No response

Device

No response

ReactiveUI Version

20.1.63

Additional information ℹ️

No response

glennawatson commented 2 weeks ago

https://www.reactiveui.net/docs/guidelines/platform/windows-presentation-framework.html

The generic -windows in the target framework won't work due to system.reactive not supporting it.

| An advanced, composable, reactive model-view-viewmodel framework
glennawatson commented 2 weeks ago

The part that's important is the

Ensure that you install ReactiveUI.WPF into your application.

Please ensure that you are targeting at least windows10.0.17763.0

i.e net8.0-windows10.0.17763.0 in your csproj file.

GerdWB commented 2 weeks ago

Ok, thanks, that works. Normally I just leave the version as its is provided by the VisualStudio template.

glennawatson commented 2 weeks ago

Yeah it's a bit of a pain. The theory is more up to date versions allow you to get bug fixes but still target old versions.