{"record":{"id":"09ec2e082faf18bd","repo":"stride3d/stride","slug":"support-of-externalidentifiableasguid-without","errorCode":null,"errorMessage":"Support of ExternalIdentifiableAsGuid without ReuseReferences is not implemented yet.","messagePattern":"Support of ExternalIdentifiableAsGuid without ReuseReferences is not implemented yet\\.","errorType":"exception","errorClass":"NotImplementedException","httpStatus":null,"severity":"error","filePath":"sources/core/Stride.Core/Serialization/SerializerSelector.cs","lineNumber":62,"sourceCode":"\n        Asset = new SerializerSelector(false, -1, \"Default\", \"Content\");\n        Asset.Initialize();\n\n        AssetWithReuse = new SerializerSelector(true, -1, \"Default\", \"Content\");\n        AssetWithReuse.Initialize();\n    }\n\n    /// <summary>\n    /// Initializes a new instance of the <see cref=\"SerializerSelector\"/> class.\n    /// </summary>\n    /// <param name=\"reuseReferences\">if set to <c>true</c> reuse references (allow cycles in the object graph).</param>\n    /// <param name=\"profiles\">The profiles.</param>\n    public SerializerSelector(bool reuseReferences, bool externalIdentifiableAsGuid, params string[] profiles)\n    {\n        ReuseReferences = reuseReferences;\n        ExternalIdentifiableAsGuid = externalIdentifiableAsGuid;\n        if (externalIdentifiableAsGuid && !reuseReferences)\n            throw new NotImplementedException(\"Support of ExternalIdentifiableAsGuid without ReuseReferences is not implemented yet.\");\n        this.profiles = profiles;\n        Initialize();\n    }\n\n    public SerializerSelector(params string[] profiles) : this(false, false, profiles)\n    {\n    }\n\n    /// <summary>\n    /// Checks if this instance supports the specified serialization profile.\n    /// </summary>\n    /// <param name=\"profile\">Name of the profile</param>\n    /// <returns><c>true</c> if this instance supports the specified serialization profile</returns>\n    public bool HasProfile(string profile)\n    {\n        ArgumentNullException.ThrowIfNull(profile);\n        for (var i = 0; i < profiles.Length; i++)\n        {","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/core/Stride.Core/Serialization/SerializerSelector.cs#L44-L80","documentation":"SerializerSelector is Stride's serialization profile selector. The ExternalIdentifiableAsGuid option (serializing IIdentifiable objects as raw GUIDs instead of inline references) relies on the reference-tracking machinery that only exists when ReuseReferences is enabled, so the constructor rejects the invalid combination at construction time.","triggerScenarios":"Calling new SerializerSelector(externalIdentifiableAsGuid: true, reuseReferences: false, ...) — i.e. passing profiles with reuseReferences=false and externalIdentifiableAsGuid=true. The convenience constructor new SerializerSelector(profiles) passes (false,false), so it never triggers this.","commonSituations":"Hand-building serialization options for asset or content loading (e.g. ContentManagerSerializerSettings) where a developer toggles ExternalIdentifiableAsGuid but forgets that ReuseReferences must be true; copying flags from config where the two booleans are set independently.","solutions":["Enable ReuseReferences whenever ExternalIdentifiableAsGuid is true: new SerializerSelector(true, externalIdentifiableAsGuid, profiles)","Or drop the ExternalIdentifiableAsGuid flag if GUID-only representation is not required","Centralize serializer-settings construction so the two flags are always set together"],"exampleFix":"// before\nvar selector = new SerializerSelector(false, true, \"assets\");\n// after\nvar selector = new SerializerSelector(true, true, \"assets\");","handlingStrategy":"validation","validationCode":"if (externalIdentifiableAsGuid && !reuseReferences)\n    throw new ArgumentException(\"ExternalIdentifiableAsGuid requires ReuseReferences=true\");\nvar selector = new SerializerSelector(reuseReferences, externalIdentifiableAsGuid, profiles);","typeGuard":null,"tryCatchPattern":"try { selector = new SerializerSelector(reuse, asGuid, profiles); }\ncatch (NotImplementedException e) { /* fix flags: asGuid requires reuse */ }","preventionTips":["Always set ExternalIdentifiableAsGuid and ReuseReferences from one shared options object","Add an assertion/unit test covering the flag combination used in production settings"],"tags":["serialization","invalid-config-value"],"backgroundTag":"conflicting-config-options","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"}