{"record":{"id":"1bd094c5b64e3215","repo":"abpframework/abp","slug":"given-type-is-not-an-abp-module-moduletype-assem","errorCode":null,"errorMessage":"Given type is not an ABP module: {moduleType.AssemblyQualifiedName}","messagePattern":"Given type is not an ABP module: (.+?)","errorType":"exception","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"framework/src/Volo.Abp.Core/Volo/Abp/Modularity/AbpModule.cs","lineNumber":126,"sourceCode":"\n    }\n\n    public static bool IsAbpModule(Type type)\n    {\n        var typeInfo = type.GetTypeInfo();\n\n        return\n            typeInfo.IsClass &&\n            !typeInfo.IsAbstract &&\n            !typeInfo.IsGenericType &&\n            typeof(IAbpModule).GetTypeInfo().IsAssignableFrom(type);\n    }\n\n    internal static void CheckAbpModuleType(Type moduleType)\n    {\n        if (!IsAbpModule(moduleType))\n        {\n            throw new ArgumentException(\"Given type is not an ABP module: \" + moduleType.AssemblyQualifiedName);\n        }\n    }\n\n    protected void Configure<TOptions>(Action<TOptions> configureOptions)\n        where TOptions : class\n    {\n        ServiceConfigurationContext.Services.Configure(configureOptions);\n    }\n\n    protected void Configure<TOptions>(string name, Action<TOptions> configureOptions)\n        where TOptions : class\n    {\n        ServiceConfigurationContext.Services.Configure(name, configureOptions);\n    }\n\n    protected void Configure<TOptions>(IConfiguration configuration)\n        where TOptions : class\n    {","sourceCodeStart":108,"sourceCodeEnd":144,"githubUrl":"https://github.com/abpframework/abp/blob/7ed43b1931b9df46a50c0c59148a18645641d0df/framework/src/Volo.Abp.Core/Volo/Abp/Modularity/AbpModule.cs#L108-L144","documentation":"Thrown by AbpModule.CheckAbpModuleType when a Type passed to the module system does not satisfy IsAbpModule (must be a non-abstract, non-generic class implementing IAbpModule). It is an ArgumentException naming the offending AssemblyQualifiedName.","triggerScenarios":"Calling DependsOn or PlugInSources with a Type that is an interface, abstract, generic, or simply does not implement IAbpModule; or adding a non-module type to a module dependency list.","commonSituations":"Registering a plain class or a marker interface as a module by mistake, a plugin assembly whose module type was renamed/removed after an upgrade, or DependsOnAttribute pointing at the wrong type.","solutions":["Make the referenced type a real module: a non-abstract, non-generic class implementing IAbpModule (typically deriving from AbpModule).","Correct the type reference in DependsOnAttribute / PlugInSources to point at an actual module.","Rebuild/realign the plugin assembly so it contains the expected module type after a version bump.","Verify the type is loaded from the assembly you think (check AssemblyQualifiedName spelling)."],"exampleFix":"// before\n[DependsOn(typeof(SomeHelper))]\npublic class MyModule : AbpModule { }\n\n// after\npublic class SomeHelperModule : AbpModule { /* ... */ }\n\n[DependsOn(typeof(SomeHelperModule))]\npublic class MyModule : AbpModule { }","handlingStrategy":"validation","validationCode":"static bool IsModule(Type t)\n    => t.IsClass && !t.IsAbstract && !t.IsGenericType\n       && typeof(IAbpModule).IsAssignableFrom(t);\n\nif (!IsModule(candidate)) throw new InvalidOperationException($\"{candidate} is not a module\");","typeGuard":"static bool IsAbpModule(Type t) => AbpModule.IsAbpModule(t);","tryCatchPattern":"try { AbpModule.CheckAbpModuleType(candidate); }\ncatch (ArgumentException ex)\n{\n    logger.LogError(ex, \"Type {Type} is not an ABP module\", candidate);\n}","preventionTips":["Derive custom modules from AbpModule so they always satisfy IsAbpModule.","Double-check DependsOnAttribute type arguments after refactors.","Validate plugin module types at load time before adding to the sources."],"tags":["modularity","argument","type-system","plugins","abp-core"],"backgroundTag":null,"analyzedSha":"7ed43b1931b9df46a50c0c59148a18645641d0df","analyzedAt":"2026-08-13T16:26:11.351Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}