{"record":{"id":"8319d3aac42d4421","repo":"stride3d/stride","slug":"the-path-tostring-contains-access-to-non-existing-member","errorCode":null,"errorMessage":"The path [{ToString()}] contains access to non-existing member [{name}].","messagePattern":"The path \\[(.+?)\\] contains access to non-existing member \\[(.+?)\\]\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"sources/assets/Stride.Core.Assets/Yaml/YamlAssetPath.cs","lineNumber":237,"sourceCode":"    /// <returns>An instance of <see cref=\"MemberPath\"/> corresponding to the same target than this <see cref=\"YamlAssetPath\"/>.</returns>\n    [Pure]\n    public MemberPath ToMemberPath(object root)\n    {\n        var currentObject = root;\n        var memberPath = new MemberPath();\n        foreach (var item in Elements)\n        {\n            if (currentObject is null)\n                throw new InvalidOperationException($\"The path [{ToString()}] contains access to a member of a null object.\");\n\n            switch (item.Type)\n            {\n                case ElementType.Member:\n                    {\n                        var typeDescriptor = TypeDescriptorFactory.Default.Find(currentObject.GetType());\n                        var name = item.AsMember();\n                        var memberDescriptor = typeDescriptor.Members.FirstOrDefault(x => x.Name == name)\n                            ?? throw new InvalidOperationException($\"The path [{ToString()}] contains access to non-existing member [{name}].\");\n                        memberPath.Push(memberDescriptor);\n                        currentObject = memberDescriptor.Get(currentObject);\n                        break;\n                    }\n                case ElementType.Index:\n                    {\n                        var typeDescriptor = TypeDescriptorFactory.Default.Find(currentObject.GetType());\n                        if (typeDescriptor is ArrayDescriptor arrayDescriptor)\n                        {\n                            if (item.Value is not int)\n                            {\n                                throw new InvalidOperationException($\"The path [{ToString()}] contains non-integer index on an array.\");\n                            }\n                            int value = (int)item.Value;\n                            memberPath.Push(arrayDescriptor, value);\n                            currentObject = arrayDescriptor.GetValue(currentObject, value);\n                        }\n                        else if (typeDescriptor is CollectionDescriptor collectionDescriptor)","sourceCodeStart":219,"sourceCodeEnd":255,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/assets/Stride.Core.Assets/Yaml/YamlAssetPath.cs#L219-L255","documentation":"YamlAssetPath.ToMemberPath looks up each Member element in the current object's type descriptor. If no member with that name exists, it throws InvalidOperationException('The path [...] contains access to non-existing member [name].') — the recorded path no longer matches the object's schema.","triggerScenarios":"Calling ToMemberPath(root) with a path containing a member name absent from the runtime type — typically after renaming or deleting a property in an asset type between versions.","commonSituations":"Asset-upgrade scripts applying old-version paths to new-version objects; typos in hand-built YamlAssetPath; serialized metadata from a different project schema version.","solutions":["Update or regenerate the stored paths for the new schema (write an upgrader mapping old member names to new ones)","Verify each member exists via TypeDescriptorFactory.Default.Find(type).Members before resolving","Handle the exception per-path: catch it, log, and skip metadata for that path","Use the MemberSerialization upgrade/renaming support so old paths are migrated on load"],"exampleFix":"// before\nvar memberPath = path.ToMemberPath(asset); // throws if member renamed\n// after\ntry { var memberPath = path.ToMemberPath(asset); }\ncatch (InvalidOperationException) { logger.Warn($\"Stale path skipped: {path}\"); }","handlingStrategy":"try-catch","validationCode":"var td = TypeDescriptorFactory.Default.Find(root.GetType());\nbool exists = path.Elements\n    .Where(e => e.Type == YamlAssetPath.ElementType.Member)\n    .All(e => td.Members.Any(m => m.Name == e.AsMember()));","typeGuard":null,"tryCatchPattern":"try { var mp = path.ToMemberPath(root); }\ncatch (InvalidOperationException ex) { logger.Warn(ex, $\"Stale schema path skipped: {path}\"); }","preventionTips":["Write asset upgraders that remap renamed members in stored paths","Validate paths against the current type descriptor before use","Skip-and-log unknown paths instead of failing the whole import"],"tags":["yaml","paths","schema-mismatch","reflection"],"backgroundTag":"schema-validation-failed","analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}