{"record":{"id":"82fc9af641da15a5","repo":"stride3d/stride","slug":"object-doesn-t-match-can-t-reload","errorCode":null,"errorMessage":"Object doesn't match, can't reload","messagePattern":"Object doesn't match, can't reload","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"sources/core/Stride.Core.Serialization/Serialization/Contents/ContentManager.cs","lineNumber":314,"sourceCode":"            ParentReference = parentReference;\n            Url = url;\n            ObjectType = objectType;\n            Object = obj;\n        }\n    }\n\n    private object DeserializeObject(string initialUrl, string newUrl, Type type, object? obj, ContentManagerLoaderSettings settings)\n    {\n        var serializeOperations = new Queue<DeserializeOperation>();\n        serializeOperations.Enqueue(new DeserializeOperation(null, newUrl, type, obj));\n\n        Reference? reference = null;\n        if (obj != null)\n        {\n            reference = FindDeserializedObject(initialUrl, type);\n            if (reference?.Object != obj)\n            {\n                throw new InvalidOperationException(\"Object doesn't match, can't reload\");\n            }\n        }\n\n        // Let's put aside old references, so that we unload them only afterwise (avoid a referenced object to be unloaded for no reason)\n        HashSet<Reference> references = null!;\n        if (reference != null)\n        {\n            // Let's collect dependent reference, and reset current list\n            references = reference.References;\n            reference.References = [];\n\n            // Mark object as not deserialized yet\n            reference.Deserialized = false;\n        }\n\n        bool isFirstOperation = true;\n        object result = null;\n","sourceCodeStart":296,"sourceCodeEnd":332,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/core/Stride.Core.Serialization/Serialization/Contents/ContentManager.cs#L296-L332","documentation":"Reload consistency check in ContentManager.DeserializeObject: a Reload was requested on an existing object, but the object passed in is not the same instance currently referenced for that url/type. The manager refuses to overwrite a different live object during reload to avoid aliasing mismatches.","triggerScenarios":"Thrown at sources/core/Stride.Core.Serialization/Serialization/Contents/ContentManager.cs:314 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass the exact object previously returned by Load when calling Reload","Unload first and then Load fresh instead of reloading a substitute instance","Check for duplicate loads of the same url through different paths"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}