{"record":{"id":"f05ac136c4027a44","repo":"stride3d/stride","slug":"could-not-resolve-type-typename","errorCode":null,"errorMessage":"Could not resolve type {typeName}","messagePattern":"Could not resolve type (.+?)","errorType":"validation","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"sources/engine/Stride.Engine/Updater/UpdateEngine.cs","lineNumber":261,"sourceCode":"\n                        // Check if it started with a parenthesis (to perform a cast operation)\n                        if (animationPath.Name[propertyStart] == PathCastOpen)\n                        {\n                            // Parse until end of cast operation\n                            state.ParseElementEnd = animationPath.Name.IndexOf(PathCastClose, ++propertyStart);\n                            if (state.ParseElementEnd == -1)\n                                throw new InvalidOperationException(\"Property path parse error: could not find cast operation ending ')'\");\n\n                            var typeName = animationPath.Name.Substring(propertyStart, state.ParseElementEnd - propertyStart);\n\n                            // Include the indexer close\n                            state.ParseElementEnd++;\n\n                            // Try to resolve using alias first, then full assembly registry using assembly qualified name\n                            var type = DataSerializerFactory.GetTypeFromAlias(typeName) ?? AssemblyRegistry.GetType(typeName);\n                            if (type == null)\n                            {\n                                throw new InvalidOperationException($\"Could not resolve type {typeName}\");\n                            }\n\n                            // Push entry with new type\n                            // TODO: Should we actually perform an early castclass and skip if type is incorrect?\n                            state.StackPath.Add(new AnimationBuilderStackEntry(type, state.ParseElementStart, state.ParseElementEnd, -1)\n                            {\n                                ObjectStartOffset = state.NewOffset,\n                            });\n                        }\n                        else\n                        {\n                            UpdatableMember updatableMember = null;\n\n                            // Parse until end next group (or end)\n                            state.ParseElementEnd = animationPath.Name.IndexOfAny(PathGroupDelimiters, state.ParseElementStart + 1);\n                            if (state.ParseElementEnd == -1)\n                                state.ParseElementEnd = animationPath.Name.Length;\n","sourceCodeStart":243,"sourceCodeEnd":279,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/engine/Stride.Engine/Updater/UpdateEngine.cs#L243-L279","documentation":"After extracting the type name from a cast segment like '(MyType)Member' in an animation property path, UpdateEngine resolves it first via DataSerializerFactory.GetTypeFromAlias and then via AssemblyRegistry.GetType. If both fail, the cast names a type that is not aliased and not registered in any loaded assembly, so compilation cannot proceed.","triggerScenarios":"A cast in the animation property path references a type name that is neither a registered alias nor an assembly-qualified name known to AssemblyRegistry, e.g. '[(WrongType)Member]' or using a type from an unloaded assembly.","commonSituations":"Typos in type names, missing namespace, using short name instead of assembly-qualified name when ambiguous, or referencing types from assemblies not loaded/registered at compile time (e.g. plugin assemblies not referenced).","solutions":["Correct the type name in the path; use the full namespace-qualified name","If ambiguous, use the assembly-qualified name (Type.FullName + ', ' + assembly name)","Ensure the assembly containing the type is loaded and registered with AssemblyRegistry before compiling","Register a type alias via DataSerializerFactory if you want to use a short name"],"exampleFix":"// before\nvar path = '[(MyComponent)Member]'; // unresolved\n// after\nvar path = '[(MyGame.MyNamespace.MyComponent)Member]';","handlingStrategy":"validation","validationCode":"static void EnsureCastTypeResolvable(string path) { foreach (var m in System.Text.RegularExpressions.Regex.Matches(path, \"\\\\(([^)]+)\\\\)\")) { var tn = ((System.Text.RegularExpressions.Match)m).Groups[1].Value; if (DataSerializerFactory.GetTypeFromAlias(tn) == null && AssemblyRegistry.GetType(tn) == null) throw new ArgumentException($\"Type '{tn}' in path is not registered\"); } }","typeGuard":null,"tryCatchPattern":"try { var compiler = UpdateEngine.Compile(path, type, ...); } catch (InvalidOperationException ex) when (ex.Message.StartsWith(\"Could not resolve type\")) { // surface the offending type name\n    var tn = ex.Message.Replace(\"Could not resolve type \", \"\"); throw new ArgumentException($\"Unknown type '{tn}' in animation path '{path}'\", ex); }","preventionTips":["Use fully qualified type names in casts within paths","Register aliases for commonly used types at startup","Ensure referenced assemblies are loaded before compiling animation paths","Add a startup test that compiles all known animation paths"],"tags":["animation","property-path","type-resolution","casting"],"backgroundTag":"class-not-found","analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}