{"record":{"id":"b699123c8c2581b4","repo":"dotnet/wpf","slug":"sr-format-sr-propertypathnoproperty-ownertype-name","errorCode":null,"errorMessage":"SR.Format(SR.PropertyPathNoProperty, ownerType.Name, propertyName)","messagePattern":"SR\\.Format\\(SR\\.PropertyPathNoProperty, ownerType\\.Name, propertyName\\)","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/PropertyPath.cs","lineNumber":637,"sourceCode":"                {\n                    accessor = TypeDescriptor.GetProperties(item)[propertyName];\n                }\n\n                // 5. PropertyInfo.\n                if (accessor == null)\n                {\n                    accessor = GetPropertyHelper(ownerType, propertyName);\n                }\n\n                // 6. IDynamicMetaObjectProvider\n                // This supports the DLR's dynamic objects\n                if (accessor == null && SystemCoreHelper.IsIDynamicMetaObjectProvider(item))\n                {\n                    accessor = SystemCoreHelper.NewDynamicPropertyAccessor(item.GetType(), propertyName);\n                }\n\n                if (accessor == null && throwOnError)\n                    throw new InvalidOperationException(SR.Format(SR.PropertyPathNoProperty, ownerType.Name, propertyName));\n\n                return accessor;\n            }\n\n            return null;\n        }\n\n        private PropertyInfo GetPropertyHelper(Type ownerType, string propertyName)\n        {\n            PropertyInfo result = null;\n            bool enumerateBaseClasses = false;\n            bool returnIndexerProperty = false;\n\n            try\n            {\n                result = ownerType.GetProperty(propertyName, BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.FlattenHierarchy);\n            }\n            catch (AmbiguousMatchException)","sourceCodeStart":619,"sourceCodeEnd":655,"githubUrl":"https://github.com/dotnet/wpf/blob/81131a70a4c573cd62748a5c36908fc4d662daa9/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/PropertyPath.cs#L619-L655","documentation":"ResolvePropertyName throws this InvalidOperationException when the owner type was resolved but the requested property name does not exist on that type. WPF searched CLR properties, dependency properties, and indexed-property accessors (including IDynamicMetaObjectProvider dynamic accessors) and found none matching propertyName, so the path is unresolvable.","triggerScenarios":"Binding path like '(local:Customer.FirstNmae)' where the property is misspelled; the property was removed/renamed on the owner type; the property is private/static so no public accessor is found; a dynamic object lacking the requested member.","commonSituations":"Refactorings renaming model properties without updating XAML binding paths; case-sensitivity mismatches; binding to properties that only exist on a derived type while the bound item is the base type; INotifyPropertyChanged property names drifting from actual CLR property names.","solutions":["Correct the property-name spelling in the path string to match the actual property on ownerType","Verify the property exists and is public on the type: check ownerType.GetProperty(propertyName) returns non-null","If the property lives on a derived type, ensure the bound item's runtime type exposes it, or cast/adjust the path","For dynamic objects, confirm the member name is provided by the TryGetMember implementation"],"exampleFix":"// before\nvar path = new PropertyPath(\"(local:Customer.FirstNmae)\", ctx);\n// after (typo fixed)\nvar path = new PropertyPath(\"(local:Customer.FirstName)\", ctx);","handlingStrategy":"validation","validationCode":"bool propertyExists = typeof(Customer).GetProperty(\"FirstName\",\n    System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Instance) != null;","typeGuard":"bool HasPublicProperty(object o, string name) =>\n    o?.GetType().GetProperty(name, System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Instance) != null;","tryCatchPattern":"try { var path = new PropertyPath(\"(local:Customer.FirstName)\", ctx); }\ncatch (InvalidOperationException ex) when (ex.Message.Contains(\"has no property\")) { /* correct the property name */ }","preventionTips":["Verify property names against the model class when writing binding paths","Keep INotifyPropertyChanged notification names identical to CLR property names","Run binding-path unit tests after any model refactor"],"tags":["wpf","binding","property-path","property-not-found"],"backgroundTag":"resource-not-found","analyzedSha":"81131a70a4c573cd62748a5c36908fc4d662daa9","analyzedAt":"2026-09-14T10:12:48.479Z","contentChangedAt":"2026-09-14T10:12:48.479Z","schemaVersion":2},"datasetVersion":"2026-09-21T21:30:21.729Z"}