.NET Community Toolkit is a collection of helpers and APIs that work for all .NET developers and are agnostic of any specific UI platform. The toolkit is maintained and published by Microsoft, and part of the .NET Foundation.
I've asked around on SO and discord, but getting no joy. Forgive me if this is my misunderstanding. My SO post:
I'm getting build errors despite the SourceGenerator apparently working correctly. Example code:
namespace VisGit.ViewModels
{
public partial class MainViewModel: ObservableObject
{
[ObservableProperty]
string _exceptionMessageText = "Exception Text";
public MainViewModel()
{
ExceptionMessageText = "Test Change";
}
}
}
Intellisense shows the public property ExceptionMessageText as being generated successfully:
Also, source generator appears to work:
However, I get the build error The name 'ExceptionMessageText' does not exist in the current context:
Not sure what I'm dong wrong. I'm using .net Framework 4.8 (is that the issue?). Any ideas?
Regression
No response
Steps to reproduce
1. Create a new VSIX Project w/Tool Window project
2. Create any Class creating a new ObservableProperty via the Attribute
Expected behavior
priavte var is converted to Public property and usable in same class. Project also builds without error "The name '[x]' does not exist in the current context"
Describe the bug
I've asked around on SO and discord, but getting no joy. Forgive me if this is my misunderstanding. My SO post: I'm getting build errors despite the SourceGenerator apparently working correctly. Example code:
Intellisense shows the public property
ExceptionMessageText
as being generated successfully:Also, source generator appears to work:
However, I get the build error
The name 'ExceptionMessageText' does not exist in the current context
:Full code: https://github.com/stigzler/VisGit/blob/1-setup-base-extension-environment/VisGit/ViewModels/MainViewModel.cs
Not sure what I'm dong wrong. I'm using .net Framework 4.8 (is that the issue?). Any ideas?
Regression
No response
Steps to reproduce
Expected behavior
priavte var is converted to Public property and usable in same class. Project also builds without error "The name '[x]' does not exist in the current context"
Screenshots
See OP
IDE and version
VS 2022
IDE version
4.8.09032
Nuget packages
Nuget package version(s)
8.2.2
Additional context
No response
Help us help you
Yes, I'd like to be assigned to work on this item