{"record":{"id":"e7ef4b0715d5f204","repo":"EllanJiang/GameFramework","slug":"you-can-not-use-verifyresourcepack-without-updatable","errorCode":null,"errorMessage":"You can not use VerifyResourcePack without updatable resource mode.","messagePattern":"You can not use VerifyResourcePack without updatable resource mode\\.","errorType":"validation","errorClass":"GameFrameworkException","httpStatus":null,"severity":"error","filePath":"GameFramework/Resource/ResourceManager.cs","lineNumber":1377,"sourceCode":"        {\n            if (string.IsNullOrEmpty(resourcePackPath))\n            {\n                throw new GameFrameworkException(\"Resource pack path is invalid.\");\n            }\n\n            if (!File.Exists(resourcePackPath))\n            {\n                throw new GameFrameworkException(Utility.Text.Format(\"Resource pack '{0}' is not exist.\", resourcePackPath));\n            }\n\n            if (m_ResourceMode == ResourceMode.Unspecified)\n            {\n                throw new GameFrameworkException(\"You must set resource mode first.\");\n            }\n\n            if (m_ResourceMode != ResourceMode.Updatable && m_ResourceMode != ResourceMode.UpdatableWhilePlaying)\n            {\n                throw new GameFrameworkException(\"You can not use VerifyResourcePack without updatable resource mode.\");\n            }\n\n            if (m_ResourcePackVersionListSerializer == null)\n            {\n                throw new GameFrameworkException(\"You can not use VerifyResourcePack at this time.\");\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_ResourcePackVersionListSerializer.Deserialize(fileStream);\n                }\n\n                if (!versionList.IsValid)","sourceCodeStart":1359,"sourceCodeEnd":1395,"githubUrl":"https://github.com/EllanJiang/GameFramework/blob/d0c010b05167c58e92350449d04864a91ca13fd2/GameFramework/Resource/ResourceManager.cs#L1359-L1395","documentation":"VerifyResourcePack is only supported in updatable resource modes. When m_ResourceMode is Package (or Unspecified, caught earlier), ResourceManager throws this GameFrameworkException because resource packs only exist in the updatable download pipeline. Package-mode games embed all resources and have nothing to verify.","triggerScenarios":"Calling VerifyResourcePack while ResourceMode is ResourceMode.Package; switching a build back to package mode but leaving a verify-pack routine in the startup path.","commonSituations":"Reusing update/verify code between a Package-mode demo build and an Updatable production build; a feature flag toggles mode but the verify call remains unconditional.","solutions":["Set ResourceMode.Updatable or ResourceMode.UpdatableWhilePlaying when pack verification is needed.","Guard the VerifyResourcePack call with a check that the mode is updatable.","Remove or disable pack-verification code in package-mode builds via conditional compilation or config."],"exampleFix":"// before\nresourceManager.VerifyResourcePack(packPath); // Package mode\n// after\nif (resourceManager.ResourceMode == ResourceMode.Updatable || resourceManager.ResourceMode == ResourceMode.UpdatableWhilePlaying)\n{\n    resourceManager.VerifyResourcePack(packPath);\n}","handlingStrategy":"validation","validationCode":"bool ok = rm.ResourceMode == ResourceMode.Updatable || rm.ResourceMode == ResourceMode.UpdatableWhilePlaying;\nif (!ok) return;","typeGuard":"static bool IsUpdatableMode(ResourceMode mode) => mode == ResourceMode.Updatable || mode == ResourceMode.UpdatableWhilePlaying;","tryCatchPattern":"try { rm.VerifyResourcePack(p); } catch (GameFrameworkException ex) { Log.Warn(\"Verify skipped: \" + ex.Message); }","preventionTips":["Compile out / feature-flag pack verification in Package builds","Gate all pack APIs behind an updatable-mode check","Keep mode selection in one config location"],"tags":["gameframework","resource-mode","resource-pack","unsupported-operation"],"backgroundTag":"unsupported-operation","analyzedSha":"d0c010b05167c58e92350449d04864a91ca13fd2","analyzedAt":"2026-09-15T13:37:15.352Z","contentChangedAt":"2026-09-15T13:37:15.352Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}