Updated plugin installation

This commit is contained in:
2024-07-06 18:42:45 +03:00
parent 48a133d58c
commit 2052eb634a
6 changed files with 66 additions and 10 deletions

View File

@@ -6,6 +6,7 @@ using System.Reflection;
namespace DiscordBot;
public static class Entry
{
/// <summary>
@@ -58,7 +59,7 @@ public static class Entry
static Assembly LoadFromSameFolder(object sender, ResolveEventArgs args)
{
string requestingAssembly = args.RequestingAssembly?.GetName().Name;
var folderPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, $"Libraries\\{requestingAssembly}");
var folderPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, $"Libraries/{requestingAssembly}");
var assemblyPath = Path.Combine(folderPath, new AssemblyName(args.Name).Name + ".dll");
if (!File.Exists(assemblyPath))
return null;