abpframework/abp · error · ArgumentException
Given type is not an ABP module: {moduleType.AssemblyQualifi
Error message
Given type is not an ABP module: {moduleType.AssemblyQualifiedName} What it means
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.
Source
Thrown at framework/src/Volo.Abp.Core/Volo/Abp/Modularity/AbpModule.cs:126
}
public static bool IsAbpModule(Type type)
{
var typeInfo = type.GetTypeInfo();
return
typeInfo.IsClass &&
!typeInfo.IsAbstract &&
!typeInfo.IsGenericType &&
typeof(IAbpModule).GetTypeInfo().IsAssignableFrom(type);
}
internal static void CheckAbpModuleType(Type moduleType)
{
if (!IsAbpModule(moduleType))
{
throw new ArgumentException("Given type is not an ABP module: " + moduleType.AssemblyQualifiedName);
}
}
protected void Configure<TOptions>(Action<TOptions> configureOptions)
where TOptions : class
{
ServiceConfigurationContext.Services.Configure(configureOptions);
}
protected void Configure<TOptions>(string name, Action<TOptions> configureOptions)
where TOptions : class
{
ServiceConfigurationContext.Services.Configure(name, configureOptions);
}
protected void Configure<TOptions>(IConfiguration configuration)
where TOptions : class
{View on GitHub (pinned to 7ed43b1931)
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).
Example fix
// before
[DependsOn(typeof(SomeHelper))]
public class MyModule : AbpModule { }
// after
public class SomeHelperModule : AbpModule { /* ... */ }
[DependsOn(typeof(SomeHelperModule))]
public class MyModule : AbpModule { } Defensive patterns
Strategy: validation
Validate before calling
static bool IsModule(Type t)
=> t.IsClass && !t.IsAbstract && !t.IsGenericType
&& typeof(IAbpModule).IsAssignableFrom(t);
if (!IsModule(candidate)) throw new InvalidOperationException($"{candidate} is not a module"); Type guard
static bool IsAbpModule(Type t) => AbpModule.IsAbpModule(t);
Try / catch
try { AbpModule.CheckAbpModuleType(candidate); }
catch (ArgumentException ex)
{
logger.LogError(ex, "Type {Type} is not an ABP module", candidate);
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Given module instance ({instance.GetType().AssemblyQualified
- Given type ({item.AssemblyQualifiedName}) should be instance
- Could not find a depended module {dependedModuleType.Assembl
- Could not get module types from assembly: {assembly.FullName
- Could not get module types from assembly: {assembly.FullName
AI-assisted analysis of abpframework/abp@7ed43b1931 (2026-08-13).
Data as JSON: /api/errors/1bd094c5b64e3215.
Report an issue: GitHub.