{"record":{"id":"10ad1e05231cc243","repo":"stride3d/stride","slug":"unable-to-decode-asset-part-reference-0-expecting-an-entity","errorCode":null,"errorMessage":"Unable to decode asset part reference [{0}]. Expecting an ENTITY_GUID","messagePattern":"Unable to decode asset part reference \\[(.+?)\\]\\. Expecting an ENTITY_GUID","errorType":"validation","errorClass":"YamlException","httpStatus":null,"severity":"error","filePath":"sources/assets/Stride.Core.Assets/Serializers/IdentifiableAssetPartReferenceSerializer.cs","lineNumber":22,"sourceCode":"using Stride.Core.Yaml;\nusing Stride.Core.Yaml.Events;\nusing Stride.Core.Yaml.Serialization;\n\nnamespace Stride.Core.Assets.Serializers;\n\n[YamlSerializerFactory(YamlAssetProfile.Name)]\npublic sealed class IdentifiableAssetPartReferenceSerializer : ScalarOrObjectSerializer\n{\n    public override bool CanVisit(Type type)\n    {\n        return type == typeof(IdentifiableAssetPartReference);\n    }\n\n    public override object ConvertFrom(ref ObjectContext context, Scalar fromScalar)\n    {\n        if (!Guid.TryParse(fromScalar.Value, out var guid))\n        {\n            throw new YamlException(fromScalar.Start, fromScalar.End, \"Unable to decode asset part reference [{0}]. Expecting an ENTITY_GUID\".ToFormat(fromScalar.Value));\n        }\n\n        var result = context.Instance as IdentifiableAssetPartReference ?? (IdentifiableAssetPartReference)(context.Instance = new IdentifiableAssetPartReference());\n        result.Id = guid;\n\n        return result;\n    }\n\n    public override string ConvertTo(ref ObjectContext objectContext)\n    {\n        return ((IdentifiableAssetPartReference)objectContext.Instance).Id.ToString();\n    }\n}\n","sourceCodeStart":4,"sourceCodeEnd":36,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/assets/Stride.Core.Assets/Serializers/IdentifiableAssetPartReferenceSerializer.cs#L4-L36","documentation":"This error is thrown by IdentifiableAssetPartReferenceSerializer.ConvertFrom when a YAML scalar that should represent an asset part reference cannot be parsed as a Guid. Stride asset files (.sdfmt/.yaml) reference asset parts by their GUID; the serializer expects the scalar value to be a valid ENTITY_GUID string. If Guid.TryParse fails, the YAML deserialization of the asset part reference is aborted with this YamlException.","triggerScenarios":"Deserializing a Stride asset YAML where a scalar appears where an entity/asset-part GUID is expected, but the scalar is not parseable by Guid.TryParse (e.g. a name string, a relative path, an empty value, or a truncated GUID).","commonSituations":"Hand-editing .sdfmt asset files and mistyping a GUID; assets referencing parts whose GUID was corrupted by a bad merge, find/replace, or external tool; copy-pasting identifiers without the GUID portion.","solutions":["Open the asset YAML at the reported line and replace the scalar with a valid entity GUID (32 hex digits or standard Guid string form)","If the referenced part no longer exists, remove the stale asset part reference entry from the YAML","Regenerate or re-save the asset in the Stride Game Studio so a correct GUID is written","Check for merge conflicts in the asset file and resolve by keeping one side's GUID, not a mixed value"],"exampleFix":"// before (in .sdfmt asset)\nReferencedPart: my-part-name\n// after\nReferencedPart: 38a9a1a7-8e13-4b8f-9d10-2b62a4e5c001","handlingStrategy":"validation","validationCode":"if (Guid.TryParse(scalarValue, out var guid)) { /* proceed */ } else { /* fix or skip this reference */ }","typeGuard":"bool IsValidEntityGuid(string? s) => s != null && Guid.TryParse(s, out _);","tryCatchPattern":"try { return serializer.ConvertFrom(ref context, scalar); } catch (YamlException ex) { log.Error($\"Bad asset part reference at {ex.Start}: {ex.Message}\"); throw; }","preventionTips":["Never hand-edit GUIDs in .sdfmt files; re-save assets in the editor","Resolve merge conflicts in asset files by keeping one whole side","Validate asset YAML before committing with a parse script"],"tags":["yaml","guid","deserialization","assets"],"backgroundTag":"invalid-identifier-format","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"}