You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 25, 2026. It is now read-only.
Compilation fails If the Microsoft MVVM Toolkit source generator attribute [ObservableProperty] is in a #region block.
Is this bug a regression in the toolkit? If so, what toolkit version did you last see it work:
Steps to Reproduce
Can this be reproduced in the Sample App? (Either in a sample as-is or with new XAML pasted in the editor.) If so, please provide custom XAML or steps to reproduce. If not, let us know why it can't be reproduced (e.g. more complex setup, environment, dependencies, etc...)
Describe the bug
Compilation fails If the Microsoft MVVM Toolkit source generator attribute [ObservableProperty] is in a
#regionblock.Steps to Reproduce
Sample project:
https://github.com/JasonWei512/MicrosoftMvvmToolkitSourceGeneratorBug
Steps to reproduce the behavior:
When compiling the following code, you will get a "
CS1038 #endregion directive expected" error:If you delete the
#region Propertiesand#endregionlines, the code will compile:Expected behavior
The code should compile.
Screenshots
None.
Environment
NuGet Package(s):
Package Version(s):
Windows 10 Build Number:
App min and target version:
Device form factor:
Visual Studio version:
Additional context
None.