EllanJiang/GameFramework · error · GameFrameworkException

Deserialize resource pack version list failure.

Error message

Deserialize resource pack version list failure.

What it means

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.

Solutions

  1. Verify the pack file is complete and re-download/re-copy it, comparing length or checksum with the server
  2. Rebuild the resource pack with the same framework/resource version as the runtime
  3. Confirm the path passed to ApplyResources points to an actual resource pack, not another file

Example fix

// before
resourceManager.ApplyResources(localPath); // stale/corrupt pack
// after
if (FileLengthMatchesManifest(localPath, expectedSize)) resourceManager.ApplyResources(localPath);
else DownloadPackAgain(expectedSize);
Defensive patterns

Strategy: validation

Validate before calling

// verify pack integrity before applying
var fi = new FileInfo(packPath);
if (fi.Length < manifest.MinLength || !ChecksumMatches(packPath, manifest.Checksum)) Redownload();

Try / catch

try { resourceManager.ApplyResources(packPath); } catch (GameFrameworkException ex) { Log.Error("Bad resource pack, redownloading: " + ex.Message); RedownloadPack(); }

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: Checksum mismatch errors: "checksum verification failed", "digest mismatch", "expected vs actual checksum" — what they mean and how to fix them — this error's family across 41 libraries.

Related errors


AI-assisted analysis of EllanJiang/GameFramework@d0c010b051 (2026-09-15). Data as JSON: /api/errors/6881e45d9cce3892. Report an issue: GitHub.

Appendix: source

Thrown at GameFramework/Resource/ResourceManager.ResourceUpdater.cs:350

                if (m_UpdateWaitingInfoWhilePlaying.Count > 0)
                {
                    throw new GameFrameworkException("There are already some resources being updated while playing.");
                }

                try
                {
                    long length = 0L;
                    ResourcePackVersionList versionList = default(ResourcePackVersionList);
                    using (FileStream fileStream = new FileStream(resourcePackPath, FileMode.Open, FileAccess.Read))
                    {
                        length = fileStream.Length;
                        versionList = m_ResourceManager.m_ResourcePackVersionListSerializer.Deserialize(fileStream);
                    }

                    if (!versionList.IsValid)
                    {
                        throw new GameFrameworkException("Deserialize resource pack version list failure.");
                    }

                    if (versionList.Offset + versionList.Length != length)
                    {
                        throw new GameFrameworkException("Resource pack length is invalid.");
                    }

                    m_ApplyingResourcePackPath = resourcePackPath;
                    m_ApplyingResourcePackStream = new FileStream(resourcePackPath, FileMode.Open, FileAccess.Read);
                    m_ApplyingResourcePackStream.Position = versionList.Offset;
                    m_FailureFlag = false;

                    long totalLength = 0L;
                    ResourcePackVersionList.Resource[] resources = versionList.GetResources();
                    foreach (ResourcePackVersionList.Resource resource in resources)
                    {
                        ResourceName resourceName = new ResourceName(resource.Name, resource.Variant, resource.Extension);
                        UpdateInfo updateInfo = null;

View on GitHub (pinned to d0c010b051)