{"record":{"id":"176576a64842e1d7","repo":"AvaloniaUI/Avalonia","slug":"the-propertyinfoaccessorplugin-does-not-support-dy","errorCode":null,"errorMessage":"The PropertyInfoAccessorPlugin does not support dynamic matching","messagePattern":"The PropertyInfoAccessorPlugin does not support dynamic matching","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Avalonia.Base/Data/Core/Plugins/PropertyInfoAccessorPlugin.cs","lineNumber":19,"sourceCode":"﻿using System;\nusing System.Diagnostics;\n\nnamespace Avalonia.Data.Core.Plugins;\n\ninternal class PropertyInfoAccessorPlugin : IPropertyAccessorPlugin\n{\n    private readonly IPropertyInfo _propertyInfo;\n    private readonly Func<WeakReference<object?>, IPropertyInfo, IPropertyAccessor> _accessorFactory;\n\n    public PropertyInfoAccessorPlugin(IPropertyInfo propertyInfo, Func<WeakReference<object?>, IPropertyInfo, IPropertyAccessor> accessorFactory)\n    {\n        _propertyInfo = propertyInfo;\n        _accessorFactory = accessorFactory;\n    }\n\n    public bool Match(object obj, string propertyName)\n    {\n        throw new InvalidOperationException(\"The PropertyInfoAccessorPlugin does not support dynamic matching\");\n    }\n\n    public IPropertyAccessor Start(WeakReference<object?> reference, string propertyName)\n    {\n        Debug.Assert(_propertyInfo.Name == propertyName);\n        return _accessorFactory(reference, _propertyInfo);\n    }\n}\n","sourceCodeStart":1,"sourceCodeEnd":28,"githubUrl":"https://github.com/AvaloniaUI/Avalonia/blob/11c542726898ae954a1ef668c65ec79ec92ab17d/src/Avalonia.Base/Data/Core/Plugins/PropertyInfoAccessorPlugin.cs#L1-L28","documentation":"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.","triggerScenarios":"Registering PropertyInfoAccessorPlugin in the reflection-binding accessor plugin list and resolving a binding that probes Match on each plugin.","commonSituations":"Mixing compiled-binding plugins into the reflection binding configuration; custom accessor chains built incorrectly.","solutions":["Keep PropertyInfoAccessorPlugin for compiled-binding paths only.","Use InpcPropertyAccessorPlugin (or other Match-supporting plugin) for reflection bindings.","Do not enumerate this plugin in any Match-based lookup."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Exclude Match-unsupported plugins from any reflection accessor lookup:\nplugins = plugins.Where(p => p is not PropertyInfoAccessorPlugin).ToList();","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Reserve PropertyInfoAccessorPlugin for compiled-binding paths only.","Do not enumerate it in Match-based accessor resolution.","Maintain separate plugin lists for reflection vs compiled bindings."],"tags":["binding","accessor-plugin","compiled-binding","configuration"],"backgroundTag":null,"analyzedSha":"11c542726898ae954a1ef668c65ec79ec92ab17d","analyzedAt":"2026-08-13T11:57:40.261Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}