skip to Main Content

I’m learning .NET Maui and using MS Community Visual Studio and I’m following .NET Maui for Beginners created by James Montemagno, Product Manager, Microsoft. After using the ‘Manage NuGet packages and installing CommunityToolkit.Mvvm ver 8.2.2, I have created the following code from the lesson material:

using CommunityToolkit.Mvvm.ComponentModel;
using System.ComponentModel;

namespace MauiApp1.ViewModel;

public partial class MainViewModel : ObservableObject
{
    [ObservableProperty]
    string text;
}

I receive the following errors
Dependencies_net7.0-android_Analyzers_CommunityToolKitMvvm.SourceGenerators

Could someone point me in the right direction?
Thank you

I have tried removing the CommunityToolkit.Mvvm and installing an earlier version.

2

Answers


  1. First, When Jason told you that you should not post images of errors, he meant that you should place text instead. I had to look for your "errors" in the edit history.

    Second, those are not errors. This what you are looking at is not even a warning.
    Plain and simple the toolkit is telling you that it is capable of.

    If you want to learn more, you can search about diagnostic analyzers.

    Login or Signup to reply.
  2. Actually, I can replicate the issue when firstly installing the CommunityToolkit.Mvvm version:8.2.2.

    If you want to eliminate the errors produced by the SourceGenerators, you can try to install the CommunityToolkit.Mvvm version:8.0.0 and then upgrade its version to 8.2.2, the errors would vanish like below:

    enter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search