abpframework/abp · critical · AbpException
Could not get module types from assembly
Error message
Could not get module types from assembly: {assembly.FullName} What it means
Thrown by FolderPlugInSource when assembly.GetTypes() raises while scanning every assembly in a plug-in folder for module types. Identical mechanism to FilePlugInSource but triggered for an entire folder scan. Wrapped as AbpException with the offending assembly FullName and the original as InnerException.
Solutions
- Inspect ex.InnerException.LoaderExceptions to identify the broken assembly and its missing dependency.
- Clean the plug-in folder so it contains only valid, compatible plug-in assemblies and their dependencies.
- Use a Filter on the FolderPlugInSource to restrict which files are scanned.
- Rebuild all plug-ins in the folder against the host's framework and ABP version.
Defensive patterns
Strategy: validation
Validate before calling
// Use a Filter to restrict which folder assemblies are scanned,
// and validate each loads before scanning:
static bool SafeGetTypes(Assembly a)
{
try { _ = a.GetTypes(); return true; } catch { return false; }
} Try / catch
try { var modules = folderSource.GetModules(); }
catch (AbpException ex)
{
var loadEx = ex.InnerException as ReflectionTypeLoadException;
foreach (var le in loadEx?.LoaderExceptions ?? Array.Empty<Exception>())
logger.LogCritical(le, "Folder plug-in loader error");
} Prevention
- Keep plug-in folders clean — only valid plug-in DLLs and their deps.
- Apply a Filter to the FolderPlugInSource to skip unrelated files.
- Rebuild all folder plug-ins together against the host's framework version.
When it happens
Trigger: Configuring a plug-in folder (AddFolder / FolderPlugInSource) that contains one or more assemblies whose GetTypes() fails.
Common situations: A plug-in folder that also holds unrelated/third-party DLLs with broken dependencies, stale DLLs left from a previous build, or mixed target frameworks in the folder.
Related errors
- Could not get module types from assembly
- Could not find a depended module
- Given module instance
- Given type is not an ABP module
- An error occurred during the initialize
AI-assisted analysis of abpframework/abp@7ed43b1931 (2026-08-13).
Data as JSON: /api/errors/80f02f1ad316269b.
Report an issue: GitHub.
Appendix: source
Thrown at framework/src/Volo.Abp.Core/Volo/Abp/Modularity/PlugIns/FolderPlugInSource.cs:48
public Type[] GetModules()
{
var modules = new List<Type>();
foreach (var assembly in GetAssemblies())
{
try
{
foreach (var type in assembly.GetTypes())
{
if (AbpModule.IsAbpModule(type))
{
modules.AddIfNotContains(type);
}
}
}
catch (Exception ex)
{
throw new AbpException("Could not get module types from assembly: " + assembly.FullName, ex);
}
}
return modules.ToArray();
}
private List<Assembly> GetAssemblies()
{
var assemblyFiles = AssemblyHelper.GetAssemblyFiles(Folder, SearchOption);
if (Filter != null)
{
assemblyFiles = assemblyFiles.Where(Filter);
}
return assemblyFiles.Select(AssemblyLoadContext.Default.LoadFromAssemblyPath).ToList();
}
}View on GitHub (pinned to 7ed43b1931)