MVVM Toolkit error MVVMTK0026

Cannot apply [NotifyDataErrorInfo] to fields that don't have any validation attributes to use during validation.

The following sample generates MVVMTK0026:

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

namespace MyApp;

public partial class SampleViewModel : ObservableValidator
{
    // This property is requesting validation but has no validation attributes
    [ObservableProperty]
    [NotifyDataErrorInfo]
    private string name;
}

Additional resources