using System.Collections.Generic; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.Loader; namespace Abp.Reflection { internal static class AssemblyHelper { public static List GetAllAssembliesInFolder(string folderPath, SearchOption searchOption) { var assemblyFiles = Directory .EnumerateFiles(folderPath, "*.*", searchOption) .Where(s => s.EndsWith(".dll") || s.EndsWith(".exe")); return assemblyFiles.Select( Assembly.LoadFile ).ToList(); } } }