{"record":{"id":"04496d14e8e49bd2","repo":"stride3d/stride","slug":"unable-to-find-property-0-in-class-1-04496d","errorCode":null,"errorMessage":"Unable to find property [{0}] in class [{1}]","messagePattern":"Unable to find property \\[(.+?)\\] in class \\[(.+?)\\]","errorType":"exception","errorClass":"YamlException","httpStatus":null,"severity":"error","filePath":"sources/core/Stride.Core.Design/Yaml/PropertyKeyYamlSerializer.cs","lineNumber":50,"sourceCode":"\n    public override object? ConvertFrom(ref ObjectContext objectContext, Scalar fromScalar)\n    {\n        var lastDot = fromScalar.Value.LastIndexOf('.');\n        if (lastDot == -1)\n            return null;\n\n        var className = fromScalar.Value[..lastDot];\n        var containingClass = objectContext.SerializerContext.TypeFromTag(\"!\" + className, out _); // Readd initial '!'\n        if (containingClass == null)\n        {\n            throw new YamlException(fromScalar.Start, fromScalar.End, \"Unable to find class from tag [{0}]\".ToFormat(className));\n        }\n\n        var propertyName = fromScalar.Value[(lastDot + 1)..];\n        var propertyField = containingClass.GetField(propertyName, BindingFlags.Public | BindingFlags.Static);\n        if (propertyField == null)\n        {\n            throw new YamlException(fromScalar.Start, fromScalar.End, \"Unable to find property [{0}] in class [{1}]\".ToFormat(propertyName, containingClass.Name));\n        }\n\n        return propertyField.GetValue(null);\n    }\n\n    protected override void WriteScalar(ref ObjectContext objectContext, ScalarEventInfo scalar)\n    {\n        // TODO: if ParameterKey is written to an object, It will not serialized a tag\n        scalar.Tag = null;\n        scalar.IsPlainImplicit = true;\n        base.WriteScalar(ref objectContext, scalar);\n    }\n\n    public override string ConvertTo(ref ObjectContext objectContext)\n    {\n        var propertyKey = (PropertyKey)objectContext.Instance;\n\n        return PropertyKeyNameResolver.ComputePropertyKeyName(objectContext.SerializerContext, propertyKey);","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/core/Stride.Core.Design/Yaml/PropertyKeyYamlSerializer.cs#L32-L68","documentation":"After resolving the containing class, PropertyKeyYamlSerializer.ConvertFrom looks up the property name as a public static field via reflection. When GetField returns null it throws YamlException 'Unable to find property [{0}] in class [{1}]'.","triggerScenarios":"YAML scalar 'Class.Property' where the class exists but has no public static field with that exact name — misspelled property, property removed/renamed, non-public field, or an instance (non-static) member.","commonSituations":"Renamed or removed PropertyKey between versions; typos in hand-edited YAML; trying to reference a non-static property; case mismatches.","solutions":["Confirm the property exists as a public static field on the named class with exact casing","Update the YAML to the current property name after refactors","Ensure the referenced member is static and public (BindingFlags.Public | BindingFlags.Static)","Catch YamlException and provide a default/skip strategy for missing keys"],"exampleFix":"// before\nkey: Stride.Engine.ModelComponent.OldMaterial\n// after\nkey: Stride.Engine.ModelComponent.Material","handlingStrategy":"try-catch","validationCode":"var dot = scalar.LastIndexOf('.');\nvar prop = scalar[(dot+1)..];\nbool exists = containingType?.GetField(prop, BindingFlags.Public | BindingFlags.Static) != null;","typeGuard":null,"tryCatchPattern":"try { key = serializer.ConvertFrom(ctx, scalar); }\ncatch (YamlException ex) { /* skip or substitute default property */ }","preventionTips":["Keep PropertyKey names stable or migrate YAML on rename","Reference only public static fields","Check exact casing in YAML"],"tags":["yaml","serialization","reflection","propertykey"],"backgroundTag":"resource-not-found","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"}