{"record":{"id":"c9db1c8bd1f92f8d","repo":"EllanJiang/GameFramework","slug":"resource-group-0-is-not-exist","errorCode":null,"errorMessage":"Resource group '{0}' is not exist.","messagePattern":"Resource group '(.+?)' is not exist\\.","errorType":"validation","errorClass":"GameFrameworkException","httpStatus":null,"severity":"error","filePath":"GameFramework/Resource/ResourceManager.cs","lineNumber":2196,"sourceCode":"        public IResourceGroupCollection GetResourceGroupCollection(params string[] resourceGroupNames)\n        {\n            if (resourceGroupNames == null || resourceGroupNames.Length < 1)\n            {\n                throw new GameFrameworkException(\"Resource group names is invalid.\");\n            }\n\n            ResourceGroup[] resourceGroups = new ResourceGroup[resourceGroupNames.Length];\n            for (int i = 0; i < resourceGroupNames.Length; i++)\n            {\n                if (string.IsNullOrEmpty(resourceGroupNames[i]))\n                {\n                    throw new GameFrameworkException(\"Resource group name is invalid.\");\n                }\n\n                resourceGroups[i] = (ResourceGroup)GetResourceGroup(resourceGroupNames[i]);\n                if (resourceGroups[i] == null)\n                {\n                    throw new GameFrameworkException(Utility.Text.Format(\"Resource group '{0}' is not exist.\", resourceGroupNames[i]));\n                }\n            }\n\n            return new ResourceGroupCollection(resourceGroups, m_ResourceInfos);\n        }\n\n        /// <summary>\n        /// 获取资源组集合。\n        /// </summary>\n        /// <param name=\"resourceGroupNames\">要获取的资源组名称的集合。</param>\n        /// <returns>要获取的资源组集合。</returns>\n        public IResourceGroupCollection GetResourceGroupCollection(List<string> resourceGroupNames)\n        {\n            if (resourceGroupNames == null || resourceGroupNames.Count < 1)\n            {\n                throw new GameFrameworkException(\"Resource group names is invalid.\");\n            }\n","sourceCodeStart":2178,"sourceCodeEnd":2214,"githubUrl":"https://github.com/EllanJiang/GameFramework/blob/d0c010b05167c58e92350449d04864a91ca13fd2/GameFramework/Resource/ResourceManager.cs#L2178-L2214","documentation":"GetResourceGroupCollection resolves each name via GetResourceGroup; if no resource group with that name exists, the resolved group is null and this formatted GameFrameworkException is thrown naming the missing group. The collection cannot be built from a group that was never added.","triggerScenarios":"Calling GetResourceGroupCollection with a name that was never created via AddResourceGroup / loaded resource list — e.g. a typo or a group defined only in a newer resource config version.","commonSituations":"Resource config updated on the server but the group name hardcoded in client code is stale; case-mismatch between the configured name and the lookup name.","solutions":["Use the exact resource group name defined in the resource configuration","Add the missing resource group before building a collection over it (AddResourceGroup)","Log available groups (GetAllResourceGroups) to find the correct name"],"exampleFix":"// before\nvar col = manager.GetResourceGroupCollection(\"UiRes\"); // group is named \"UIRes\"\n// after\nif (manager.GetResourceGroup(\"UiRes\") == null)\n    manager.AddResourceGroup(\"UiRes\", ...);\nvar col = manager.GetResourceGroupCollection(\"UiRes\");","handlingStrategy":"validation","validationCode":"if (manager.GetResourceGroup(name) == null)\n    throw new InvalidOperationException($\"Resource group '{name}' does not exist; register it first.\");","typeGuard":"bool GroupExists(ResourceManager m, string name) => m.GetResourceGroup(name) != null;","tryCatchPattern":"try { var col = manager.GetResourceGroupCollection(names); }\ncatch (GameFrameworkException ex) when (ex.Message.Contains(\"is not exist\")) { log.Error(ex.Message); /* prompt for correct group or add it */ }","preventionTips":["Add all resource groups during startup before any collection use","Keep group names in one shared constants class","Verify group names against the resource config version shipped with the build"],"tags":["csharp","gameframework","resource-not-found","resource-groups"],"backgroundTag":"resource-not-found","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"}