[Bug]: CS0433 for DispatcherScheduler with 18.4.22 on net7.0-windows10.0.19041
Yarith opened this issue · 3 comments
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
- Create a new .net 7.0 wpf project
- 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>
- Go to the
MainWindow.xaml.cs
file and add following usingusing System.Reactive.Concurrency;
. - 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;
}
}
- 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 🖼️
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
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.
Please update to version 18.4.25 to resolve this, thank you for raising this.
Please let us know if you find anything else.
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.