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]: CS0433 for DispatcherScheduler with 18.4.22 on net7.0-windows10.0.19041 #3493

Closed
Yarith opened this issue Mar 4, 2023 · 3 comments · Fixed by #3494
Closed

[Bug]: CS0433 for DispatcherScheduler with 18.4.22 on net7.0-windows10.0.19041 #3493

Yarith opened this issue Mar 4, 2023 · 3 comments · Fixed by #3494
Labels

Comments

@Yarith
Copy link

Yarith commented Mar 4, 2023

Describe the bug 🐞

In projects which target .net7.0-windows10.0.19041 you can not simply access DispatcherScheduler with the current version 18.4.22. It does not compile because following error gets produces:

Schweregrad Code Beschreibung Projekt Datei Zeile Unterdrückungszustand
Fehler CS0433 Der Typ "DispatcherScheduler" ist in "ReactiveUI.Wpf, Version=18.4.0.0, Culture=neutral, PublicKeyToken=null" und "System.Reactive, Version=5.0.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263" vorhanden. ReactiveUITest MainWindow.xaml.cs 28 Aktiv

The last version which had worked was 18.4.1. The new version is targeting .NET 7.0 and i wanted to test if #3432 does not happen anymore.

With net7.0-windows10.0.17763 it can compile the test project, described in the reproduction steps. For my real project i do need a higher version.

Additionally with the update to Visual Studio 17.5.1, it has caused for me, that i can not even step while debugging, because it wants to apply code changes. Previously at least i could step but not change anything. I was hoping i could solve it with the update to the newest version, but sadly the project does not compile with the new version for me.

Step to reproduce

  1. Create a new .net 7.0 wpf project
  2. Change the content of the project file to following text:
<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>WinExe</OutputType>
    <TargetFramework>net7.0-windows10.0.19041</TargetFramework>
    <Nullable>enable</Nullable>
    <UseWPF>true</UseWPF>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="ReactiveUI" Version="18.4.22" />
    <PackageReference Include="ReactiveUI.Fody" Version="18.4.22" />
    <PackageReference Include="ReactiveUI.WPF" Version="18.4.22" />
    <PackageReference Include="System.Reactive" Version="5.0.0" />
    <PackageReference Include="System.Reactive.PlatformServices" Version="5.0.0" />
  </ItemGroup>

</Project>
  1. Go to the MainWindow.xaml.cs file and add following using using System.Reactive.Concurrency;.
  2. Try access DispatcherScheduler.Current in the constructor:
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
   public MainWindow()
   {
       InitializeComponent();

       var _ = DispatcherScheduler.Current;
    }
}
  1. Look in the error list and you can see the error CS0433.

Reproduction repository

https://github.com/reactiveui/ReactiveUI

Expected behavior

DispatcherScheduler should still not have any conflict with the System.Reactive package.

Screenshots 🖼️

image

IDE

Visual Studio 2022

Operating system

Windows

Version

Windows 10 22H2 (Build 19045.2604), Visual Studio 17.5.1

Device

No response

ReactiveUI Version

18.4.22

Additional information ℹ️

No response

@Yarith Yarith added the bug label Mar 4, 2023
@ChrisPulman
Copy link
Member

Hi @Yarith thanks for raising this as a potential issue, I will take a look into this today and give you feedback on my findings.

ChrisPulman added a commit that referenced this issue Mar 4, 2023
Fix for #3493
Added 19041 target as a workaround for System.Reactive targeting net5.0-windows10.0.19041.0
When 19041 is selected by the end user it causes the DispatcherScheduler in System.Reactive to be exposed and used.
@ChrisPulman
Copy link
Member

Please update to version 18.4.25 to resolve this, thank you for raising this.
Please let us know if you find anything else.

@github-actions
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 Mar 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
2 participants