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 FilePlugInSource when assembly.GetTypes() raises (typically a ReflectionTypeLoadException) while scanning a plug-in assembly for ABP module types. The original exception is wrapped as AbpException (InnerException preserved) and the offending assembly FullName is named. It means the plug-in assembly could not be introspected.

Source

Thrown at framework/src/Volo.Abp.Core/Volo/Abp/Modularity/PlugIns/FilePlugInSource.cs:36

        var modules = new List<Type>();

        foreach (var filePath in FilePaths)
        {
            var assembly = AssemblyLoadContext.Default.LoadFromAssemblyPath(filePath);

            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();
    }
}

View on GitHub (pinned to 7ed43b1931)

Solutions

  1. Inspect ex.InnerException (ReflectionTypeLoadException.LoaderExceptions) to find the missing assembly/type.
  2. Deploy all of the plug-in's dependencies alongside it in the probing path.
  3. Rebuild the plug-in against the same ABP and target-framework version as the host.
  4. If the assembly is not meant to be a plug-in, remove it from the plug-in source.
Defensive patterns

Strategy: try-catch

Validate before calling

// Before scanning, verify the assembly loads cleanly:
static bool CanLoadTypes(string path)
{
    try { return Assembly.LoadFrom(path).GetTypes().Length >= 0; }
    catch { return false; }
}

Try / catch

try { var modules = plugInSource.GetModules(); }
catch (AbpException ex)
{
    var loadEx = ex.InnerException as ReflectionTypeLoadException;
    foreach (var le in loadEx?.LoaderExceptions ?? Array.Empty<Exception>())
        logger.LogCritical(le, "Plug-in loader error");
}

Prevention

When it happens

Trigger: Adding a plug-in via AddFile / a FilePlugInSource whose DLL fails GetTypes() — missing dependency, mismatched framework target, or a type with a missing base class.

Common situations: A plug-in built against a different ABP/framework version, a plug-in whose dependency DLL is not in the probing path, or a .NET Standard vs .NET Core target mismatch.

Related errors


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