public Type[] GetModules() { var modules = new List <Type> (); foreach (var assembly in GetAssemblies()) { try { foreach (var type in assembly.GetTypes()) { if (RocketModule.IsRocketModule(type)) { modules.AddIfNotContains(type); } } } catch (Exception ex) { throw new RocketException("Could not get module types from assembly: " + assembly.FullName, ex); } } return(modules.ToArray()); }
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 (RocketModule.IsRocketModule(type)) { modules.AddIfNotContains(type); } } } catch (Exception ex) { throw new RocketException("Could not get module types from assembly: " + assembly.FullName, ex); } } return(modules.ToArray()); }