abpframework/abp · critical · AbpException

Could not get module types from assembly: {assembly.FullName

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.

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)

Solutions

  1. Inspect ex.InnerException.LoaderExceptions to identify the broken assembly and its missing dependency.
  2. Clean the plug-in folder so it contains only valid, compatible plug-in assemblies and their dependencies.
  3. Use a Filter on the FolderPlugInSource to restrict which files are scanned.
  4. 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

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


AI-assisted analysis of abpframework/abp@7ed43b1931 (2026-08-13). Data as JSON: /api/errors/80f02f1ad316269b. Report an issue: GitHub.