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