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.02k stars 1.12k forks source link

[Bug]: Hot reload not working when referencing ReactiveUI.WinUI when targeting net7.0 #3854

Closed SoggyBottomBoy closed 1 month ago

SoggyBottomBoy commented 1 month ago

Describe the bug 🐞

I was recently incorrectly referencing ReactiveUI in a WinUI project. After changing to ReactiveUI.WinUI edit & continue and hot reload stopped working. I get the following error message:

CS7038: Failed to emit module MyApp. Changing the version of an assembly reference is not allowed during debugging: 'System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' changed version to '7.0.0.0'.

If I remove the package or switch back to ReactiveUI the problem goes away.

Step to reproduce

  1. Create a WinUI project using the lastest WindowsAppSDK and target net7.0-windows10.0.19041.0
  2. Add the Reactive.WinUI nuget package to the project
  3. Debug the project
  4. Edit some code to trigger an "Edit & Continue" or HotReload
  5. Check the output from hot reload in the output window

Reproduction repository

https://github.com/reactiveui/ReactiveUI

Expected behavior

This should happen...

Screenshots 🖼️

No response

IDE

Visual Studio 2022

Operating system

Windows

Version

No response

Device

No response

ReactiveUI Version

20.1.1

Additional information ℹ️

No response

SoggyBottomBoy commented 1 month ago

I can confirm that this is an issue with 20.1.1. I downgraded to 20.0.1 then triggered a hot reload without any problem. Upgraded back to 20.1.1 and triggered a hot reload same issue forcing me to close the application.

ChrisPulman commented 1 month ago

Thank you for raising this issue, I will try to locate the root cause and release an update if necessary

glennawatson commented 1 month ago

Is it the fact it's net7? Net 7 went out of support in may 2024 so reactiveui does not support it

github-actions[bot] commented 2 weeks ago

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.