{"record":{"id":"82808be21b0c781d","repo":"abpframework/abp","slug":"could-not-find-a-depended-module-dependedmodulety","errorCode":null,"errorMessage":"Could not find a depended module {dependedModuleType.AssemblyQualifiedName} for {module.Type.AssemblyQualifiedName}","messagePattern":"Could not find a depended module (.+?) for (.+?)","errorType":"exception","errorClass":"AbpException","httpStatus":null,"severity":"critical","filePath":"framework/src/Volo.Abp.Core/Volo/Abp/Modularity/ModuleLoader.cs","lineNumber":100,"sourceCode":"    {\n        return new AbpModuleDescriptor(moduleType, CreateAndRegisterModule(services, moduleType), isLoadedAsPlugIn);\n    }\n\n    protected virtual IAbpModule CreateAndRegisterModule(IServiceCollection services, Type moduleType)\n    {\n        var module = (IAbpModule)Activator.CreateInstance(moduleType)!;\n        services.AddSingleton(moduleType, module);\n        return module;\n    }\n\n    protected virtual void SetDependencies(List<AbpModuleDescriptor> modules, AbpModuleDescriptor module)\n    {\n        foreach (var dependedModuleType in AbpModuleHelper.FindDependedModuleTypes(module.Type))\n        {\n            var dependedModule = modules.FirstOrDefault(m => m.Type == dependedModuleType);\n            if (dependedModule == null)\n            {\n                throw new AbpException(\"Could not find a depended module \" + dependedModuleType.AssemblyQualifiedName + \" for \" + module.Type.AssemblyQualifiedName);\n            }\n\n            module.AddDependency(dependedModule);\n        }\n    }\n}\n","sourceCodeStart":82,"sourceCodeEnd":107,"githubUrl":"https://github.com/abpframework/abp/blob/7ed43b1931b9df46a50c0c59148a18645641d0df/framework/src/Volo.Abp.Core/Volo/Abp/Modularity/ModuleLoader.cs#L82-L107","documentation":"Thrown by ModuleLoader.SetDependencies when a module declares a dependency (via DependsOnAttribute) whose type is not present in the loaded module set. ABP resolves all dependencies before startup, so a missing dependency aborts initialization. It is an AbpException naming both module and the missing dependency.","triggerScenarios":"A module's DependsOnAttribute references a module type that was never added to the AbpApplication (missing assembly reference, missing plug-in, or the dependency was removed).","commonSituations":"Forgetting to add a project/assembly reference for a depended module, a NuGet package downgrade that dropped a module, a plugin folder that no longer contains the dependency DLL, or a typo in DependsOn.","solutions":["Add the missing module's assembly reference (or NuGet package) to the startup project.","If the dependency is a plug-in, ensure its DLL is in the plug-in source folder and loaded.","Remove or correct the DependsOnAttribute if the dependency is no longer needed.","Verify load order: the depended module must be discoverable when SetDependencies runs."],"exampleFix":"// before\n[DependsOn(typeof(MissingModule))]\npublic class MyModule : AbpModule { }\n\n// after\n// add reference to the assembly containing MissingModule, or remove the dependency:\npublic class MyModule : AbpModule { }","handlingStrategy":"validation","validationCode":"// Before startup, ensure every DependsOn module type is loaded:\nstatic bool AllDependenciesPresent(IEnumerable<Type> loaded, Type module)\n    => AbpModuleHelper.FindDependedModuleTypes(module)\n        .All(d => loaded.Contains(d));","typeGuard":"static bool IsDependencyLoaded(Type dep, IEnumerable<Type> loaded) => loaded.Contains(dep);","tryCatchPattern":"try { await application.InitializeAsync(); }\ncatch (AbpException ex) when (ex.Message.Contains(\"Could not find a depended module\"))\n{\n    logger.LogCritical(ex, \"Missing module dependency at startup\");\n}","preventionTips":["Add assembly/NuGet references for every module in DependsOn.","Keep plug-in folders populated with all dependency DLLs.","Add a startup smoke test that builds the AbpApplication to catch missing modules early."],"tags":["modularity","dependency-resolution","startup","plugins","abp-core"],"backgroundTag":null,"analyzedSha":"7ed43b1931b9df46a50c0c59148a18645641d0df","analyzedAt":"2026-08-13T16:26:11.351Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}