Fixed PluginLoading to use the context instead of appDomain

This commit is contained in:
2025-05-22 18:07:25 +03:00
parent e57e941c94
commit a0177ce145
3 changed files with 70 additions and 73 deletions

View File

@@ -143,9 +143,16 @@ public class PluginLoader : IPluginLoader
private void LoadEverythingOfType<T>()
{
var types = AppDomain.CurrentDomain.GetAssemblies()
if (PluginLoaderContext is null)
{
_Logger.Log("The plugins are not loaded. Please load the plugins before loading them.", this, LogType.Error);
return;
}
var types = PluginLoaderContext.Assemblies
.SelectMany(s => s.GetTypes())
.Where(p => typeof(T).IsAssignableFrom(p) && !p.IsInterface);
foreach (var type in types)
{