{"record":{"id":"2313f5399bc8e116","repo":"dotnet/wpf","slug":"storyboard-propertypathpropertynotfound","errorCode":"Storyboard_PropertyPathPropertyNotFound","errorMessage":"SR.Format(SR.Storyboard_PropertyPathPropertyNotFound, path.Path)","messagePattern":"SR\\.Format\\(SR\\.Storyboard_PropertyPathPropertyNotFound, path\\.Path\\)","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Media/Animation/Storyboard.cs","lineNumber":697,"sourceCode":"        bool      checkingFrozenState = true;\n        Freezable intermediateFreezable = null;\n\n        for( int i=0; i < path.Length; i++ )\n        {\n            intermediateObject = path.GetItem(i);\n            intermediateProperty = path.GetAccessor(i);\n\n            if( intermediateObject == null )\n            {\n                Debug.Assert( i > 0, \"The caller should not have set the PropertyPath context to a null object.\" );\n                throw new InvalidOperationException(SR.Format(SR.Storyboard_PropertyPathObjectNotFound, AccessorName(path, i-1), path.Path ));\n            }\n\n            if( intermediateProperty == null )\n            {\n                // Would love to throw error with the name of the property we couldn't find,\n                //  but that information is not exposed from the PropertyPath class.\n                throw new InvalidOperationException(SR.Format(SR.Storyboard_PropertyPathPropertyNotFound, path.Path ));\n            }\n\n            // If the first property value is an immutable Freezable, then turn\n            //  off the Frozen state checking - let's hope we can use the cloning\n            //  mechanism for that case.\n            // Index of zero is the path context object itself, one (that we're\n            //  checking here) is the value of the first property.\n            // Example: Property path \"Background.Opacity\" as applied to Button.\n            //  Object 0 is the Button, object 1 is the brush.\n            if( i == 1 )\n            {\n                intermediateFreezable = intermediateObject as Freezable;\n                if( intermediateFreezable != null && intermediateFreezable.IsFrozen )\n                {\n                    checkingFrozenState = false;\n                }\n            }\n            // Freezable objects (other than the one returned as the value of","sourceCodeStart":679,"sourceCodeEnd":715,"githubUrl":"https://github.com/dotnet/wpf/blob/81131a70a4c573cd62748a5c36908fc4d662daa9/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Media/Animation/Storyboard.cs#L679-L715","documentation":"Storyboard walks each segment of a property path and needs the final (or intermediate) accessor to be a property it can animate. When PropertyPath.GetAccessor returns null for a segment, VerifyPathIsAnimatable throws this InvalidOperationException with the full path; PropertyPath does not expose which property name failed, so only the path string is reported.","triggerScenarios":"Storybard.TargetProperty contains a segment like \"(SomeType.SomeProperty)\" that resolves to no property — misspelled property name, property not on the type along the path, or an attached property not registered.","commonSituations":"Typos such as (UIElement.Opacityy); using a CLR property that is not a DependencyObject/DependencyProperty chain; referencing a property that only exists in a newer WPF version; path built dynamically from strings with bad concatenation.","solutions":["Correct the property name in the path so each (Type.Property) segment matches an existing property.","Break the path into steps and check each segment exists on the intermediate type.","Use fully qualified attached-property syntax like (Grid.Row) instead of bare names.","Validate the path string against the target type before calling Begin/Apply.","Check target framework version for properties added after your version."],"exampleFix":"// before\nnew PropertyPath(\"(UIElement.Opacityy)\");\n// after\nnew PropertyPath(\"(UIElement.Opacity)\");","handlingStrategy":"validation","validationCode":"static bool SegmentExists(DependencyObject root, string segment)\n{\n    try { var dp = DependencyPropertyDescriptor.FromName(segment, root.GetType(), root.GetType()); return dp != null; }\n    catch { return false; }\n}","typeGuard":"bool IsRegisteredDependencyProperty(Type owner, string name) =>\n    DependencyPropertyDescriptor.FromName(name, owner, owner) != null;","tryCatchPattern":"try { storyboard.Begin(target); }\ncatch (InvalidOperationException ex) when (ex.Message.Contains(\"PropertyPath\"))\n{\n    // split the path string and locate the missing property segment\n}","preventionTips":["Use IntelliSense/compile-known property names in paths","Fully qualify attached properties with (OwnerType.Property)","Check property existence on the intermediate type for dynamic paths","Pin WPF version and avoid properties newer than target framework"],"tags":["wpf","storyboard","propertypath","animation"],"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"}