{"record":{"id":"1b1fd3972bd7c3e3","repo":"abpframework/abp","slug":"could-not-get-module-types-from-assembly-assembl","errorCode":null,"errorMessage":"Could not get module types from assembly: {assembly.FullName}","messagePattern":"Could not get module types from assembly: (.+?)","errorType":"exception","errorClass":"AbpException","httpStatus":null,"severity":"critical","filePath":"framework/src/Volo.Abp.Core/Volo/Abp/Modularity/PlugIns/FilePlugInSource.cs","lineNumber":36,"sourceCode":"        var modules = new List<Type>();\n\n        foreach (var filePath in FilePaths)\n        {\n            var assembly = AssemblyLoadContext.Default.LoadFromAssemblyPath(filePath);\n\n            try\n            {\n                foreach (var type in assembly.GetTypes())\n                {\n                    if (AbpModule.IsAbpModule(type))\n                    {\n                        modules.AddIfNotContains(type);\n                    }\n                }\n            }\n            catch (Exception ex)\n            {\n                throw new AbpException(\"Could not get module types from assembly: \" + assembly.FullName, ex);\n            }\n        }\n\n        return modules.ToArray();\n    }\n}\n","sourceCodeStart":18,"sourceCodeEnd":43,"githubUrl":"https://github.com/abpframework/abp/blob/7ed43b1931b9df46a50c0c59148a18645641d0df/framework/src/Volo.Abp.Core/Volo/Abp/Modularity/PlugIns/FilePlugInSource.cs#L18-L43","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Inspect ex.InnerException (ReflectionTypeLoadException.LoaderExceptions) to find the missing assembly/type.","Deploy all of the plug-in's dependencies alongside it in the probing path.","Rebuild the plug-in against the same ABP and target-framework version as the host.","If the assembly is not meant to be a plug-in, remove it from the plug-in source."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Before scanning, verify the assembly loads cleanly:\nstatic bool CanLoadTypes(string path)\n{\n    try { return Assembly.LoadFrom(path).GetTypes().Length >= 0; }\n    catch { return false; }\n}","typeGuard":null,"tryCatchPattern":"try { var modules = plugInSource.GetModules(); }\ncatch (AbpException ex)\n{\n    var loadEx = ex.InnerException as ReflectionTypeLoadException;\n    foreach (var le in loadEx?.LoaderExceptions ?? Array.Empty<Exception>())\n        logger.LogCritical(le, \"Plug-in loader error\");\n}","preventionTips":["Deploy all plug-in dependencies in the probing path.","Build plug-ins against the same ABP/framework version as the host.","Load-test the plug-in assembly in isolation before adding it as a source."],"tags":["modularity","plugins","reflection","assembly-load","abp-core"],"backgroundTag":null,"analyzedSha":"7ed43b1931b9df46a50c0c59148a18645641d0df","analyzedAt":"2026-08-13T16:26:11.351Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}