{"record":{"id":"bbe44f91153ba6be","repo":"dotnet/wpf","slug":"sr-format-sr-storyboard-complexpathnotsupported-targetobject","errorCode":null,"errorMessage":"SR.Format(SR.Storyboard_ComplexPathNotSupported, targetObject.GetType().ToString())","messagePattern":"SR\\.Format\\(SR\\.Storyboard_ComplexPathNotSupported, targetObject\\.GetType\\(\\)\\.ToString\\(\\)\\)","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Media/Animation/Storyboard.cs","lineNumber":945,"sourceCode":"    /// </summary>\n    private void VerifyComplexPathSupport( DependencyObject targetObject )\n    {\n        if(targetObject is FrameworkElement)\n        {\n            // FrameworkElement and derived types are supported.\n            return;\n        }\n\n        if(targetObject is FrameworkContentElement)\n        {\n            // FrameworkContentElement and derived types are supported.\n            return;\n        }\n\n        // ... and anything else that knows to call into Storyboard.GetComplexPathValue.\n\n        // Otherwise - throw.\n        throw new InvalidOperationException(SR.Format(SR.Storyboard_ComplexPathNotSupported, targetObject.GetType().ToString()));\n    }\n\n    /// <summary>\n    ///     Check to see if there is a complex path that started with the\n    /// given target object and property.  If so, process the complex path\n    /// information and return the results.\n    /// </summary>\n    internal static void GetComplexPathValue(\n            DependencyObject targetObject,\n            DependencyProperty targetProperty,\n        ref EffectiveValueEntry entry, \n            PropertyMetadata metadata)\n    {\n        CloneCacheEntry cacheEntry = GetComplexPathClone(targetObject, targetProperty);\n\n        if (cacheEntry != null)\n        {\n            object baseValue = entry.Value;","sourceCodeStart":927,"sourceCodeEnd":963,"githubUrl":"https://github.com/dotnet/wpf/blob/81131a70a4c573cd62748a5c36908fc4d662daa9/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Media/Animation/Storyboard.cs#L927-L963","documentation":"Thrown by VerifyComplexPathSupport when a storyboard uses a complex property path on a target object type that does not support it. Only specific types (e.g. those hooked into Storyboard.GetComplexPathValue, like certain Freezable/attached-property scenarios) accept complex paths; anything else is rejected rather than silently ignored.","triggerScenarios":"Storyboard.TargetProperty set to a complex path string while the resolved targetObject's type is not one of the types that call into Storyboard.GetComplexPathValue; ProcessComplexPath then invokes VerifyComplexPathSupport which throws.","commonSituations":"Copying a multi-segment property path (like '(0).(1)'-style attached/complex paths) onto an arbitrary custom control; animating a POCO wrapper object; WPF-to-Silverlight-style path syntax that is unsupported on the target type.","solutions":["Replace the complex path with a direct property target: set Storyboard.TargetName/TargetProperty to the element and the DependencyProperty directly.","Break the animation into multiple storyboards, each targeting a single hop in the path on a supported type.","If intermediate values must be animated, animate the intermediate object directly (give it a name or reference it as the animation target)."],"exampleFix":"// before\nStoryboard.SetTargetProperty(sb, new PropertyPath(\"(0).(1)\", new object[] { ... })); // target type doesn't support complex paths\n// after\nStoryboard.SetTargetName(sb, \"myRect\");\nStoryboard.SetTargetProperty(sb, new PropertyPath(\"Opacity\"));","handlingStrategy":"validation","validationCode":"// Only use complex paths on supported targets\nif (path.Path.Contains(\"(\") && !(targetObject is Freezable))\n    throw new NotSupportedException(\"Complex path not supported on \" + targetObject.GetType());","typeGuard":"bool SupportsComplexPath(object target) => target is Freezable || target is FrameworkElement && !target.GetType().IsSealed && false; // prefer: keep paths simple for non-Freezables","tryCatchPattern":"try { storyboard.Begin(target, true); }\ncatch (InvalidOperationException ex) when (ex.Message.Contains(\"complex path\")) { storyboard.Begin(simpleTarget, true); }","preventionTips":["Use single-hop TargetProperty strings on regular FrameworkElements","Reserve complex paths for documented scenarios (e.g. Freezable sub-object animation)","Split deep paths into sequential storyboards per hop"],"tags":["wpf","animation","storyboard","property-path","unsupported"],"backgroundTag":"unsupported-operation","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"}