public Type[] GetModules() { var modules = new List <Type>(); foreach (var filePath in FilePaths) { var assembly = AssemblyLoadContext.Default.LoadFromAssemblyPath(filePath); try { foreach (var type in assembly.GetTypes()) { if (PlusModule.IsPlusModule(type)) { modules.AddIfNotContains(type); } } } catch (Exception ex) { throw new PlusException("Could not get module types from assembly: " + assembly.FullName, ex); } } return(modules.ToArray()); }
public Type[] GetModules() { var modules = new List <Type>(); foreach (var assembly in GetAssemblies()) { try { foreach (var type in assembly.GetTypes()) { if (PlusModule.IsPlusModule(type)) { modules.AddIfNotContains(type); } } } catch (Exception ex) { throw new PlusException("Could not get module types from assembly: " + assembly.FullName, ex); } } return(modules.ToArray()); }