This commit is contained in:
2022-12-09 14:46:10 +02:00
parent 5bb13aa4a6
commit 0527d43dd2
12 changed files with 258 additions and 226 deletions

View File

@@ -5,7 +5,6 @@ using System.Linq;
using System.Reflection;
using PluginManager.Interfaces;
using PluginManager.Others;
namespace PluginManager.Loaders
{
@@ -47,7 +46,17 @@ namespace PluginManager.Loaders
var files = Directory.GetFiles(path, $"*.{extension}", SearchOption.AllDirectories);
foreach (var file in files)
{
Assembly.LoadFrom(file);
try
{
Assembly.LoadFrom(file);
}
catch (Exception ex)
{
Logger.WriteLine(ex.Message);
Logger.WriteLine("PluginName: " + new FileInfo(file).Name.Split('.')[0] + " not loaded");
continue;
}
if (FileLoaded != null)
{
var args = new LoaderArgs
@@ -116,7 +125,7 @@ namespace PluginManager.Loaders
}
catch (Exception ex)
{
Functions.WriteErrFile(ex.ToString());
Logger.WriteErrFile(ex.ToString());
return null;
}