{"record":{"id":"bdb8262352a43f53","repo":"EllanJiang/GameFramework","slug":"you-can-not-use-verifyresourcepack-at-this-time","errorCode":null,"errorMessage":"You can not use VerifyResourcePack at this time.","messagePattern":"You can not use VerifyResourcePack at this time\\.","errorType":"validation","errorClass":"GameFrameworkException","httpStatus":null,"severity":"error","filePath":"GameFramework/Resource/ResourceManager.cs","lineNumber":1382,"sourceCode":"\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)\n                {\n                    return false;\n                }\n\n                if (versionList.Offset + versionList.Length != length)","sourceCodeStart":1364,"sourceCodeEnd":1400,"githubUrl":"https://github.com/EllanJiang/GameFramework/blob/d0c010b05167c58e92350449d04864a91ca13fd2/GameFramework/Resource/ResourceManager.cs#L1364-L1400","documentation":"VerifyResourcePack relies on m_ResourcePackVersionListSerializer, which the host layer (e.g. Unity ResourceComponent) must supply via SetResourcePackVersionListSerializer. If verification is attempted before that serializer is registered, ResourceManager throws this GameFrameworkException since it cannot read the packed version list inside the pack.","triggerScenarios":"Calling VerifyResourcePack in an updatable mode before the resource helper/serializer was injected, or the host component forgot to call SetResourcePackVersionListSerializer during initialization.","commonSituations":"Custom bootstrap code calls VerifyResourcePack directly bypassing the Unity ResourceComponent's initialization order; a serializer registration was dropped during refactor.","solutions":["Ensure the host calls SetResourcePackVersionListSerializer (with a ResourcePackVersionListSerializer wired to your text/bytes helpers) during startup before verifying.","Call VerifyResourcePack only after the full ResourceManager setup (mode + serializers + helpers) has completed.","Check initialization logs/flags to confirm serializer registration happened."],"exampleFix":"// before\nresourceManager.VerifyResourcePack(packPath); // serializer missing\n// after\nresourceManager.SetResourcePackVersionListSerializer(new ResourcePackVersionListSerializer(LoadResourcePackVersionList, ParseResourcePackVersionList));\nresourceManager.VerifyResourcePack(packPath);","handlingStrategy":"validation","validationCode":"// ensure serializer registered during bootstrap before any VerifyResourcePack call\nrm.SetResourcePackVersionListSerializer(serializer);","typeGuard":null,"tryCatchPattern":"try { rm.VerifyResourcePack(p); } catch (GameFrameworkException ex) { Log.Error(\"Serializer not registered: \" + ex.Message); }","preventionTips":["Register all serializers/helpers in one initialization routine","Enforce init order: helpers -> serializers -> mode -> verify","Add a debug assert that the serializer is non-null before verify"],"tags":["gameframework","resource-pack","missing-dependency","initialization-order"],"backgroundTag":"missing-dependency","analyzedSha":"d0c010b05167c58e92350449d04864a91ca13fd2","analyzedAt":"2026-09-15T13:37:15.352Z","contentChangedAt":"2026-09-15T13:37:15.352Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}