{"record":{"id":"6881e45d9cce3892","repo":"EllanJiang/GameFramework","slug":"deserialize-resource-pack-version-list-failure","errorCode":null,"errorMessage":"Deserialize resource pack version list failure.","messagePattern":"Deserialize resource pack version list failure\\.","errorType":"exception","errorClass":"GameFrameworkException","httpStatus":null,"severity":"error","filePath":"GameFramework/Resource/ResourceManager.ResourceUpdater.cs","lineNumber":350,"sourceCode":"\n                if (m_UpdateWaitingInfoWhilePlaying.Count > 0)\n                {\n                    throw new GameFrameworkException(\"There are already some resources being updated while playing.\");\n                }\n\n                try\n                {\n                    long length = 0L;\n                    ResourcePackVersionList versionList = default(ResourcePackVersionList);\n                    using (FileStream fileStream = new FileStream(resourcePackPath, FileMode.Open, FileAccess.Read))\n                    {\n                        length = fileStream.Length;\n                        versionList = m_ResourceManager.m_ResourcePackVersionListSerializer.Deserialize(fileStream);\n                    }\n\n                    if (!versionList.IsValid)\n                    {\n                        throw new GameFrameworkException(\"Deserialize resource pack version list failure.\");\n                    }\n\n                    if (versionList.Offset + versionList.Length != length)\n                    {\n                        throw new GameFrameworkException(\"Resource pack length is invalid.\");\n                    }\n\n                    m_ApplyingResourcePackPath = resourcePackPath;\n                    m_ApplyingResourcePackStream = new FileStream(resourcePackPath, FileMode.Open, FileAccess.Read);\n                    m_ApplyingResourcePackStream.Position = versionList.Offset;\n                    m_FailureFlag = false;\n\n                    long totalLength = 0L;\n                    ResourcePackVersionList.Resource[] resources = versionList.GetResources();\n                    foreach (ResourcePackVersionList.Resource resource in resources)\n                    {\n                        ResourceName resourceName = new ResourceName(resource.Name, resource.Variant, resource.Extension);\n                        UpdateInfo updateInfo = null;","sourceCodeStart":332,"sourceCodeEnd":368,"githubUrl":"https://github.com/EllanJiang/GameFramework/blob/d0c010b05167c58e92350449d04864a91ca13fd2/GameFramework/Resource/ResourceManager.ResourceUpdater.cs#L332-L368","documentation":"ApplyResources throws this when the deserialized ResourcePackVersionList from the pack file is not valid (IsValid is false). The serializer produced an empty/default or corrupt version list, so the pack cannot be trusted and application aborts.","triggerScenarios":"Opening a resource pack file whose trailing version-list section is missing, corrupted, or written by an incompatible serializer version; passing a non-pack file (wrong path) to ApplyResources.","commonSituations":"Interrupted download or copy that truncated the pack file; pack built by a different GameFramework/resource version than the runtime expects; pointing ApplyResources at an old or renamed pack.","solutions":["Verify the pack file is complete and re-download/re-copy it, comparing length or checksum with the server","Rebuild the resource pack with the same framework/resource version as the runtime","Confirm the path passed to ApplyResources points to an actual resource pack, not another file"],"exampleFix":"// before\nresourceManager.ApplyResources(localPath); // stale/corrupt pack\n// after\nif (FileLengthMatchesManifest(localPath, expectedSize)) resourceManager.ApplyResources(localPath);\nelse DownloadPackAgain(expectedSize);","handlingStrategy":"validation","validationCode":"// verify pack integrity before applying\nvar fi = new FileInfo(packPath);\nif (fi.Length < manifest.MinLength || !ChecksumMatches(packPath, manifest.Checksum)) Redownload();","typeGuard":null,"tryCatchPattern":"try { resourceManager.ApplyResources(packPath); } catch (GameFrameworkException ex) { Log.Error(\"Bad resource pack, redownloading: \" + ex.Message); RedownloadPack(); }","preventionTips":["Validate pack checksum/size against the server manifest before applying","Build packs with the same framework version the runtime uses","Redownload instead of retrying a corrupt file"],"tags":["csharp","gameframework","deserialization","corrupt-file"],"backgroundTag":"checksum-mismatch","analyzedSha":"d0c010b05167c58e92350449d04864a91ca13fd2","analyzedAt":"2026-09-15T13:37:15.352Z","contentChangedAt":"2026-09-15T13:37:15.352Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}