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

Adding property using [ObservableProperty] breaks hot reload #859

Open
4 tasks
nickrandolph opened this issue Apr 8, 2024 · 5 comments
Open
4 tasks

Adding property using [ObservableProperty] breaks hot reload #859

nickrandolph opened this issue Apr 8, 2024 · 5 comments
Labels
bug 🐛 An unexpected issue that highlights incorrect behavior external ⤴️ Something related to or caused by an external project mvvm-toolkit 🧰 Issues/PRs for the MVVM Toolkit needs author feedback 📝 This issue or PR needs a reply from the author

Comments

@nickrandolph
Copy link

Describe the bug

Run application
Add viewmodel class and save changes (triggering hot reload) eg

internal partial class MainViewModel : ObservableObject
{
}

Add properties and save changes (attempting to trigger hot reload) eg

[ObservableProperty]
private int _count = 0;

[ObservableProperty]
private int _step = 1;

This raises a hot reload error
image

Regression

No response

Steps to reproduce

see description

Expected behavior

Hot reload should be successful

Screenshots

No response

IDE and version

VS 2022

IDE version

No response

Nuget packages

  • CommunityToolkit.Common
  • CommunityToolkit.Diagnostics
  • CommunityToolkit.HighPerformance
  • CommunityToolkit.Mvvm (aka MVVM Toolkit)

Nuget package version(s)

8.2.2

Additional context

No response

Help us help you

No, just wanted to report this

@nickrandolph nickrandolph added the bug 🐛 An unexpected issue that highlights incorrect behavior label Apr 8, 2024
@Sergio0694
Copy link
Member

Mmh this seems like an external issue. @sharwell do you think this is some VS/Roslyn issue? Have you seen it before? 🤔

@Sergio0694 Sergio0694 added external ⤴️ Something related to or caused by an external project mvvm-toolkit 🧰 Issues/PRs for the MVVM Toolkit labels Apr 8, 2024
@sharwell
Copy link

sharwell commented Apr 8, 2024

I haven't seen that before and I can't find any other feedback with that message. A performance recording using the Report a Problem feature should collect the information necessary to find the source of the exception.

@Sergio0694 Sergio0694 added the needs author feedback 📝 This issue or PR needs a reply from the author label Apr 8, 2024
@Sergio0694
Copy link
Member

@nickrandolph can you help with that? Feel free to share a link to the VS issue here for reference. Thank you!

@forensicmike
Copy link

forensicmike commented Apr 28, 2024

FWIW, I've never successfully been able to add a RelayCommand or ObservableProperty w/ hot reload and MVVM toolkit / source generators. I seem to do more and more of my development with running processes so it's the source of some consternation.

@nickrandolph
Copy link
Author

apoloiges for the delay, will try to get repro this week

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 An unexpected issue that highlights incorrect behavior external ⤴️ Something related to or caused by an external project mvvm-toolkit 🧰 Issues/PRs for the MVVM Toolkit needs author feedback 📝 This issue or PR needs a reply from the author
Projects
None yet
Development

No branches or pull requests

4 participants