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 (XqModule.IsXqModule(type)) { modules.AddIfNotContains(type); } } } catch (Exception ex) { throw new XqException("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 (XqModule.IsXqModule(type)) { modules.AddIfNotContains(type); } } } catch (Exception ex) { throw new XqException("Could not get module types from assembly: " + assembly.FullName, ex); } } return(modules.ToArray()); }