Skip to content

Adding property using [ObservableProperty] breaks hot reload  #859

Open
@nickrandolph

Description

@nickrandolph

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🐛An unexpected issue that highlights incorrect behaviorexternal ⤴️Something related to or caused by an external projectmvvm-toolkit 🧰Issues/PRs for the MVVM Toolkitneeds author feedback 📝This issue or PR needs a reply from the author

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions