{"record":{"id":"8e8bb7f9833f5527","repo":"stride3d/stride","slug":"content-not-loaded-through-this-contentmanager","errorCode":null,"errorMessage":"Content not loaded through this ContentManager.","messagePattern":"Content not loaded through this ContentManager\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"sources/core/Stride.Core.Serialization/Serialization/Contents/ContentManager.cs","lineNumber":242,"sourceCode":"                return false;\n            }\n\n            url = reference.Url;\n            return true;\n        }\n    }\n\n    /// <summary>\n    /// Unloads the specified asset.\n    /// </summary>\n    /// <param name=\"obj\">The object to unload.</param>\n    /// <exception cref=\"InvalidOperationException\">Content not loaded through this ContentManager.</exception>\n    public void Unload(object obj)\n    {\n        lock (LoadedAssetUrls)\n        {\n            if (!LoadedAssetReferences.TryGetValue(obj, out var reference))\n                throw new InvalidOperationException(\"Content not loaded through this ContentManager.\");\n\n            // Release reference\n            DecrementReference(reference, true);\n        }\n    }\n\n    /// <summary>\n    /// Unloads the asset at the specified URL.\n    /// </summary>\n    /// <param name=\"url\">The URL.</param>\n    /// <exception cref=\"System.InvalidOperationException\">Content not loaded through this ContentManager.</exception>\n    public void Unload(string url)\n    {\n        lock (LoadedAssetUrls)\n        {\n            // Try to find already loaded object\n            if (!LoadedAssetUrls.TryGetValue(ResolveUrl(url), out var reference))\n                throw new InvalidOperationException(\"Content not loaded through this ContentManager.\");","sourceCodeStart":224,"sourceCodeEnd":260,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/core/Stride.Core.Serialization/Serialization/Contents/ContentManager.cs#L224-L260","documentation":"Ownership guard in ContentManager.Unload: the object being unloaded is not present in this ContentManager's LoadedAssetReferences table, i.e. it was never loaded through this instance (or was loaded by a different ContentManager). Each manager only tracks its own loads.","triggerScenarios":"Thrown at sources/core/Stride.Core.Serialization/Serialization/Contents/ContentManager.cs:242 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Unload the object with the same ContentManager instance that loaded it","Check IsLoaded/LoadedAssetReferences before calling Unload","If multiple managers are in play, route unload calls to the owning manager"],"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"}