AvaloniaUI/Avalonia · error · InvalidOperationException

The PropertyInfoAccessorPlugin does not support dynamic matc

Error message

The PropertyInfoAccessorPlugin does not support dynamic matching

What it means

PropertyInfoAccessorPlugin wraps a known IPropertyInfo for compiled bindings. Like MethodAccessorPlugin, its Match method throws InvalidOperationException because it cannot match by name at runtime — it requires a pre-supplied IPropertyInfo. Calling Match indicates the plugin was wrongly inserted into the reflection accessor pipeline.

Source

Thrown at src/Avalonia.Base/Data/Core/Plugins/PropertyInfoAccessorPlugin.cs:19

using System;
using System.Diagnostics;

namespace Avalonia.Data.Core.Plugins;

internal class PropertyInfoAccessorPlugin : IPropertyAccessorPlugin
{
    private readonly IPropertyInfo _propertyInfo;
    private readonly Func<WeakReference<object?>, IPropertyInfo, IPropertyAccessor> _accessorFactory;

    public PropertyInfoAccessorPlugin(IPropertyInfo propertyInfo, Func<WeakReference<object?>, IPropertyInfo, IPropertyAccessor> accessorFactory)
    {
        _propertyInfo = propertyInfo;
        _accessorFactory = accessorFactory;
    }

    public bool Match(object obj, string propertyName)
    {
        throw new InvalidOperationException("The PropertyInfoAccessorPlugin does not support dynamic matching");
    }

    public IPropertyAccessor Start(WeakReference<object?> reference, string propertyName)
    {
        Debug.Assert(_propertyInfo.Name == propertyName);
        return _accessorFactory(reference, _propertyInfo);
    }
}

View on GitHub (pinned to 11c5427268)

Solutions

  1. Keep PropertyInfoAccessorPlugin for compiled-binding paths only.
  2. Use InpcPropertyAccessorPlugin (or other Match-supporting plugin) for reflection bindings.
  3. Do not enumerate this plugin in any Match-based lookup.
Defensive patterns

Strategy: validation

Validate before calling

// Exclude Match-unsupported plugins from any reflection accessor lookup:
plugins = plugins.Where(p => p is not PropertyInfoAccessorPlugin).ToList();

Prevention

When it happens

Trigger: Registering PropertyInfoAccessorPlugin in the reflection-binding accessor plugin list and resolving a binding that probes Match on each plugin.

Common situations: Mixing compiled-binding plugins into the reflection binding configuration; custom accessor chains built incorrectly.

Related errors


AI-assisted analysis of AvaloniaUI/Avalonia@11c5427268 (2026-08-13). Data as JSON: /api/errors/176576a64842e1d7. Report an issue: GitHub.