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]: Visual Studio hot reload broken #3675

Closed
christosk92 opened this issue Nov 18, 2023 · 21 comments
Closed

[Bug]: Visual Studio hot reload broken #3675

christosk92 opened this issue Nov 18, 2023 · 21 comments
Labels

Comments

@christosk92
Copy link

Describe the bug 🐞

I’d like to know if this is indeed a bug or if it’s something on my end:

this issue occurs in both latest stable VS 17.8 and the latest preview (17.9)

I’m writing an app using WinUI 3 in WindowsAppSdk.
hot reload works fine but the moment I add the ReactiveUI package to my project, it stops working. It doesn’t even give an error, it just straight up doesn’t compile the changes and I have to rebuild the app.

ive tried falling back to previous .NET and reactiveUI version but the problem persists, making me believe it’s an issue with visual studio or some compatibility error.

anyways I’d like to know if more people experienced this or if it’s just an issue on my end even thought I’ve spent hours debugging this issue now.

thanks!

Step to reproduce

  1. create a WinUI 3 app
  2. Add ReactiveUI.WinUI to project
  3. Watch hot reload not working

Reproduction repository

No response

Expected behavior

Hot reload should work like it has

Screenshots 🖼️

No response

IDE

Visual Studio 2022

Operating system

Windows

Version

17.8

Device

No response

ReactiveUI Version

No response

Additional information ℹ️

No response

@christosk92 christosk92 changed the title [Bug]: [Bug]: Visual Studio hot reload broken Nov 18, 2023
@glennawatson
Copy link
Contributor

We are working on a new release soon so see if that resolves your issues

@christosk92
Copy link
Author

We are working on a new release soon so see if that resolves your issues

Thanks for your reply.

In the meantime I will see if falling back to a previous version of VS resolves this issue.

@christosk92
Copy link
Author

@glennawatson I was able to clone the Main branch of this repository and reference it in my app.
I can confirm this does indeed seem to fix the problem. Looking forward to an official release. Thanks !

@glennawatson
Copy link
Contributor

Thanks. Be sometime this week. I got one optimisation I want to do before release.

@christosk92
Copy link
Author

@glennawatson Eh... I think I spoke to soon. It seems that there were some incremental build shenanigans. After a full clean/rebuild the issue is back again. I have the source code running now so I might have a look at it to see what's wrong. I wasn't able to downgrade my Visual Studio (I have no idea how). Do you have any ideas perhaps why this issue might occur?

@christosk92
Copy link
Author

christosk92 commented Nov 19, 2023

My apologies, i had some internet issues while reopening the question.

@glennawatson
Copy link
Contributor

Can you produce a minimum sample that causes the issue for you.

@christosk92
Copy link
Author

christosk92 commented Nov 19, 2023

Well it happens with any new WinAppSdk project.

The basic steps are; using the latest visual studio:

  1. Create a C# WinUI with WindowsAppSdk app (not .NET Maui but actually native Windows)
  2. Run the app, observe hot reload working properly.
  3. Add the ReactiveUI.WinUI package to the project.
  4. clean and rebuild project.
  5. Observe hot reload not working anymore.

A video:
https://streamable.com/u93oq9

Streamable
Watch "2023-11-19 22-30-08" on Streamable.

@SoggyBottomBoy
Copy link

I just want to add I have similar issues, but with xaml. As soon as I add ReactiveUI as a nuget package then edit some xaml I get the following errors.

image

The types of errors are:
The specified value cannot be assigned to the collection. The following type was expected "UIElement"
The attached property "Column" can only be applied to types that derive from "UIElement"
The member "Spacing" is not recognized or is not accessible

image

The errors are generated when the xaml is edited at run time and appears to prevent xaml hot reload from working.

@christosk92
Copy link
Author

Exactly the same issue for me too.

@parched
Copy link

parched commented Nov 21, 2023

Looks like this happened when I upgraded to 17.8

@ChrisPulman
Copy link
Member

There is also similar problems with ASP.net, Console projects and VS2022 17.8, but no inclusion of ReactiveUI. I will try to debug the root cause and see if there's anything in ReactiveUI that is specifically causing the issue. From my projects the common factor is System.Reactive, either way hopefully I'll locate the issue.

@christosk92
Copy link
Author

christosk92 commented Nov 22, 2023

I actually managed to downgrade to Visual Studio 17.6 using https://learn.microsoft.com/en-us/visualstudio/releases/2022/release-history#release-dates-and-build-numbers

I can confirm that hot reload does indeed work with ReactiveUI. So it does seem like it's a regression from Visual Studio. Should we just close this issue here and report it to the vs community?

A list of released versions, build numbers, and release links for Visual Studio 2022.

@christosk92
Copy link
Author

FYI: I made a post about it on the VS developer community

https://developercommunity.visualstudio.com/t/SystemReactive-breaks-hot-reload-in-VS/10522361?sort=newest&q=hot+reload

@ChrisPulman
Copy link
Member

Lets leave it open until VS2022 17.8.xxx is fixed, just for visibility for others.
This should avoid others raising the same issue.
Thank you.

@ahardin
Copy link

ahardin commented Jan 28, 2024

FYI - this same issue appears to happen when using CommunityToolkit as well. I'm not using ReactiveUI, but I get the same lack of hot reload and the "errors" that @SoggyBottomBoy screenshotted.

You have to laugh to keep from crying. Windows App development is so miserably terrible that all these frameworks exist to make it less miserable. But you use the frameworks and VS breaks. Can't win.

@glennawatson
Copy link
Contributor

Yeah little bit hard for us this one if it's a legitimate failure by visual studio. We can probably reach out to the teams if we get a decent repo. No guarantees tho

@christosk92
Copy link
Author

Microsoft is getting very close to anti trust territory like the early 2000's.

@SoggyBottomBoy
Copy link

@christosk92 @glennawatson this bug appears fixed, I've just updated to vs 17.9 preview 5 and no longer experiencing this bug

@ChrisPulman
Copy link
Member

@christosk92 @glennawatson this bug appears fixed, I've just updated to vs 17.9 preview 5 and no longer experiencing this bug

Thank you for your feedback, glad the VS team finally got round to fixing it.

Copy link

github-actions bot commented Mar 2, 2024

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 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

6 participants