dotnet/wpf · error · NotSupportedException

SR.IndexedPropDescNotImplemented

Error message

SR.IndexedPropDescNotImplemented

What it means

PropertyPathWorker.GetValue only knows how to evaluate indexed path segments whose accessor is a DynamicIndexerAccessor; any other (non-WPF) implementation of IndexedPropDesc hits the NotSupportedException SR.IndexedPropDescNotImplemented. This means the path contains an indexer whose descriptor was not created through the expected internal accessor factory.

Solutions

  1. Ensure the indexed segment is resolved through standard WPF binding (Binding/PropertyPath) so the internal DynamicIndexerAccessor is created, not a custom IndexedPropDesc.
  2. For custom type descriptors, base indexer descriptions on the standard PropertyDescriptor/IndexerPropertyInfo mechanisms WPF expects.
  3. Replace the indexed path segment with a direct CLR path (bind to an intermediate property exposing the value) to avoid indexer evaluation.
  4. Catch NotSupportedException and fall back to evaluating the path manually via reflection.

Example fix

// before
var binding = new Binding("CustomItems[0]Name"); // custom descriptor -> NotSupportedException

// after
var binding = new Binding("FirstItemName"); // expose FirstItemName on the view-model
Defensive patterns

Strategy: fallback

Validate before calling

// prefer plain CLR path segments over indexer segments on custom descriptors
bool usesIndexer = binding.Path?.Path != null && binding.Path.Path.Contains('[');

Try / catch

try { value = EvaluatePath(item, path); }
catch (NotSupportedException ex) when (ex.Message.Contains("IndexedPropDesc"))
{
    value = EvaluateViaReflection(item, path); // manual fallback
}

Prevention

When it happens

Trigger: Evaluating a binding/item-property path with an indexed segment (e.g. "Items[3]") where the indexed property descriptor is a custom IndexedPropDesc implementation rather than the internal DynamicIndexerAccessor — typically from custom binding engines, custom ICustomTypeDescriptor output, or internal reflection paths.

Common situations: Custom data-binding frameworks or tests plugging their own property-descriptor types into WPF path evaluation; unusual indexer descriptors produced by custom TypeDescriptionProviders on bound objects.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of dotnet/wpf@81131a70a4 (2026-09-14). Data as JSON: /api/errors/bf69074e24f4c45b. Report an issue: GitHub.

Appendix: source

Thrown at src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/Data/PropertyPathWorker.cs:301

                                value = IListIndexOutOfRange;
                            }
                        }
                        else
                        {
                            // normal case
                            value = pi.GetValue(item,
                                            BindingFlags.GetProperty, null,
                                            args,
                                            CultureInfo.InvariantCulture);
                        }
                    }
                    else if ((dia = _arySVS[level].info as DynamicIndexerAccessor) != null)
                    {
                        value = dia.GetValue(item, _arySVS[level].args);
                    }
                    else
                    {
                        throw new NotSupportedException(SR.IndexedPropDescNotImplemented);
                    }
                    break;

                case SourceValueType.Direct:
                    value = item;
                    break;
            }

            if (isExtendedTraceEnabled)
            {
                object accessor = _arySVS[level].info;
                if (accessor == DependencyProperty.UnsetValue)
                    accessor = null;

                TraceData.TraceAndNotifyWithNoParameters(TraceEventType.Warning,
                                    TraceData.GetValue(
                                        TraceData.Identify(_host.ParentBindingExpression),
                                        level,

View on GitHub (pinned to 81131a70a4)