{"record":{"id":"16961be00661e213","repo":"PrismLibrary/Prism","slug":"resources-moduledependenciesnotmetingroup-formatted-with","errorCode":null,"errorMessage":"Resources.ModuleDependenciesNotMetInGroup (formatted with moduleInfo.ModuleName)","messagePattern":"Resources\\.ModuleDependenciesNotMetInGroup \\(formatted with moduleInfo\\.ModuleName\\)","errorType":"exception","errorClass":"ModularityException","httpStatus":null,"severity":"error","filePath":"src/Prism.Core/Modularity/ModuleCatalogBase.cs","lineNumber":243,"sourceCode":"        /// within that list.\n        /// </summary>\n        /// <param name=\"modules\">The modules to validate modules for.</param>\n        /// <exception cref=\"ModularityException\">\n        /// Throws if a <see cref=\"IModuleInfo\"/> in <paramref name=\"modules\"/> depends on a module that's\n        /// not in <paramref name=\"modules\"/>.\n        /// </exception>\n        /// <exception cref=\"ArgumentNullException\">Throws if <paramref name=\"modules\"/> is <see langword=\"null\"/>.</exception>\n        protected static void ValidateDependencies(IEnumerable<IModuleInfo> modules)\n        {\n            if (modules == null)\n                throw new ArgumentNullException(nameof(modules));\n\n            var moduleNames = modules.Select(m => m.ModuleName).ToList();\n            foreach (var moduleInfo in modules)\n            {\n                if (moduleInfo.DependsOn != null && moduleInfo.DependsOn.Except(moduleNames).Any())\n                {\n                    throw new ModularityException(\n                        moduleInfo.ModuleName,\n                        string.Format(CultureInfo.CurrentCulture, Resources.ModuleDependenciesNotMetInGroup, moduleInfo.ModuleName));\n                }\n            }\n        }\n\n        /// <summary>\n        /// Does the actual work of loading the catalog.  The base implementation does nothing.\n        /// </summary>\n        protected virtual void InnerLoad()\n        {\n        }\n\n        /// <summary>\n        /// Sorts a list of <see cref=\"IModuleInfo\"/>s. This method is called by <see cref=\"CompleteListWithDependencies\"/>\n        /// to return a sorted list.\n        /// </summary>\n        /// <param name=\"modules\">The <see cref=\"IModuleInfo\"/>s to sort.</param>","sourceCodeStart":225,"sourceCodeEnd":261,"githubUrl":"https://github.com/PrismLibrary/Prism/blob/358118cd640d9a22ff8cf21c8ad197fa038b7990/src/Prism.Core/Modularity/ModuleCatalogBase.cs#L225-L261","documentation":"ValidateDependencies throws ModularityException with Resources.ModuleDependenciesNotMetInGroup when a module depends on another module that is not present in the same dependency group. Prism requires all intra-group dependencies to be resolvable within the group so the group can load as a unit.","triggerScenarios":"A module in a dependency group lists a ModuleName in its DependsOn collection that does not exist among the group's modules; detected when the catalog is validated (Validate/EnsureCatalogValidated) before loading.","commonSituations":"Typo in a DependsOn entry; a module was moved out of a group (or removed) while others still depend on it; XAML/config group definitions out of sync with module names after a rename.","solutions":["Correct the DependsOn entry to match the exact ModuleName of a module in the same group.","Add the missing dependency module to the same dependency group.","Remove the stale dependency if the depended-on module no longer exists.","Search configs/XAML for the reported module name to find the mismatched reference."],"exampleFix":"// before (module 'A' in group 1 depends on 'B' which is outside the group)\nnew ModuleInfo { ModuleName = \"A\", DependsOn = new[] { \"B\" }, Group = \"Group1\" }\n// after\nnew ModuleInfo { ModuleName = \"A\", DependsOn = new[] { \"B\" }, Group = \"Group1\" },\nnew ModuleInfo { ModuleName = \"B\", Group = \"Group1\" }","handlingStrategy":"validation","validationCode":"var names = groupModules.Select(m => m.ModuleName).ToHashSet();\nforeach (var m in groupModules)\n{\n    var missing = (m.DependsOn ?? Enumerable.Empty<string>()).Where(d => !names.Contains(d)).ToList();\n    if (missing.Any())\n        throw new InvalidOperationException($\"{m.ModuleName} depends on missing group members: {string.Join(\",\", missing)}\");\n}","typeGuard":null,"tryCatchPattern":"try\n{\n    catalog.Validate();\n}\ncatch (ModularityException ex)\n{\n    logger.LogError(ex, \"Intra-group dependency not met: {0}\", ex.Message);\n    // fix the DependsOn entry or move the dependency into the same group\n}","preventionTips":["Keep dependency groups self-contained; verify with a script comparing DependsOn to group membership","Search-and-check module names after any rename","Call catalog.Validate() in unit tests at startup-configuration time"],"tags":["modularity","dependency-validation","prism"],"backgroundTag":"missing-dependency","analyzedSha":"358118cd640d9a22ff8cf21c8ad197fa038b7990","analyzedAt":"2026-09-15T15:00:31.079Z","contentChangedAt":"2026-09-15T15:00:31.079Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}