dotnet icon indicating copy to clipboard operation
dotnet copied to clipboard

[ObservableProperty] fields not being detected in Visual Studio 17.14.4

Open ThanosMantas opened this issue 8 months ago • 1 comments

Describe the bug

When using Community Toolkit 8.4.0 with Visual Studio 17.14.4, properties that are generated using the [ObservableProperty] attribute are not detected by Visual Studio's Intellisense. This makes it look like there are errors in the code, but the solution compiles without error and runs correctly.

This issue was only observed after updating to Visual Studio 17.14.4. The Community Toolkit worked well with my previous version of Visual Studio (17.14.2).

Regression

No response

Steps to reproduce

  1. Using Visual Studio 17.14.4 and Community Toolkit 8.4.0.
  2. Create a partial class.
  3. Use the [ObservableProperty] attribute to create a property.
  4. Attempt to use that property in the class' constructor (or anywhere else).
  5. The property will not be detected by Visual Studio's Intellisense, but will be used correctly during program execution.

Expected behavior

I would expect that the property generated with the [ObservableProperty] attribute to be noticed by Visual Studio.

Screenshots

Image

IDE and version

VS 2022

IDE version

17.14.4

Nuget packages

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

Nuget package version(s)

8.4.0

Additional context

No response

Help us help you

No, just wanted to report this

ThanosMantas avatar Jun 05 '25 16:06 ThanosMantas

I have noticed this as well recently, but I am on 17.13.6. I think this may have something to do with MAUI itself (i.e. in the build process), and not this library. I'm pretty sure I noticed this happening before the last time I updated this library.

But this is also something that has always kind of been an issue since the introduction of multiple compilers/analyzers/etc. where they sometimes get out of sync or aren't all caught up and have a (probably unavoidable) "dependency hell" of tasks and all that.

bzd3y avatar Jun 06 '25 17:06 bzd3y

I wanted to let anyone know that after some testing on my end, it seems this was due to a conflict with ReSharper. I was using ReSharper 2024.1, but when I updated to ReSharper 2025.1, the issue went away.

ThanosMantas avatar Jul 11 '25 19:07 ThanosMantas