CommunityToolkit 8.2.2 with Wpf .Net framework 4.8.1 gets error The name '' does not exist in the current context

Dung Huynh 141 Reputation points
2024-07-29T07:09:08.33+00:00

Hi,

I am working with WPF .Net framework 4.8.1 using CommunityToolkit 8.2.2. I've already set the LangVersion to 8.0, and migrated the package.config.

In my MainWindowViewModel, there is a ObservableProperty string _myName, the Source Generator already generated the public string MyName. However, the build keeps building failed with the error The name '' does not exist in the current context.

Here is my ViewModel

User's image

Here is the Code generator

User's image

Here is my MainWindows.xaml

User's image

Here is the error:User's image

Could you tell me what I am missing here to make the ObservableProperty works?

Thank you,

Dung Huynh.

Windows for business | Windows Client for IT Pros | Devices and deployment | Set up, install, or upgrade
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Simon Ren-MSFT 40,346 Reputation points Microsoft External Staff
    2024-07-29T08:02:27.92+00:00

    Hi,

    Thanks for posting in Microsoft MECM Q&A forum. According to your description, this issue is more related on WPF for .NET, it's recommended that you post a new thread in WPF for .NET Forum to get better support. Here are the support links:

    https://learn.microsoft.com/en-us/answers/tags/147/windows-wpf

    https://learn.microsoft.com/en-us/answers/products/97/dotnet/

    Thanks for your understanding.

    Best regards,

    Simon


    If the response is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.