dotnet/wpf · error · InvalidOperationException
Storyboard_PropertyPathPropertyNotFound
Storyboard_PropertyPathPropertyNotFound
Error message
SR.Format(SR.Storyboard_PropertyPathPropertyNotFound, path.Path)
What it means
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.
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.
Example fix
// before
new PropertyPath("(UIElement.Opacityy)");
// after
new PropertyPath("(UIElement.Opacity)"); Defensive patterns
Strategy: validation
Validate before calling
static bool SegmentExists(DependencyObject root, string segment)
{
try { var dp = DependencyPropertyDescriptor.FromName(segment, root.GetType(), root.GetType()); return dp != null; }
catch { return false; }
} Type guard
bool IsRegisteredDependencyProperty(Type owner, string name) =>
DependencyPropertyDescriptor.FromName(name, owner, owner) != null; Try / catch
try { storyboard.Begin(target); }
catch (InvalidOperationException ex) when (ex.Message.Contains("PropertyPath"))
{
// split the path string and locate the missing property segment
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Understand the failure class
Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.
Related errors
- Storyboard_PropertyPathObjectNotFound
- CannotChangeAfterSealed
- CannotChangeAfterSealed
- SR.Format(SR.Storyboard_AnimationMismatch…
- SR.Format(SR.Storyboard_ComplexPathNotSupported…
AI-assisted analysis of dotnet/wpf@81131a70a4 (2026-09-14).
Data as JSON: /api/errors/2313f5399bc8e116.
Report an issue: GitHub.
Appendix: source
Thrown at src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Media/Animation/Storyboard.cs:697
bool checkingFrozenState = true;
Freezable intermediateFreezable = null;
for( int i=0; i < path.Length; i++ )
{
intermediateObject = path.GetItem(i);
intermediateProperty = path.GetAccessor(i);
if( intermediateObject == null )
{
Debug.Assert( i > 0, "The caller should not have set the PropertyPath context to a null object." );
throw new InvalidOperationException(SR.Format(SR.Storyboard_PropertyPathObjectNotFound, AccessorName(path, i-1), path.Path ));
}
if( intermediateProperty == null )
{
// Would love to throw error with the name of the property we couldn't find,
// but that information is not exposed from the PropertyPath class.
throw new InvalidOperationException(SR.Format(SR.Storyboard_PropertyPathPropertyNotFound, path.Path ));
}
// If the first property value is an immutable Freezable, then turn
// off the Frozen state checking - let's hope we can use the cloning
// mechanism for that case.
// Index of zero is the path context object itself, one (that we're
// checking here) is the value of the first property.
// Example: Property path "Background.Opacity" as applied to Button.
// Object 0 is the Button, object 1 is the brush.
if( i == 1 )
{
intermediateFreezable = intermediateObject as Freezable;
if( intermediateFreezable != null && intermediateFreezable.IsFrozen )
{
checkingFrozenState = false;
}
}
// Freezable objects (other than the one returned as the value ofView on GitHub (pinned to 81131a70a4)