From 3195377e2534824f18274f2a5e76eaf21d9d07ce Mon Sep 17 00:00:00 2001 From: Toastie Date: Sun, 22 Sep 2024 14:24:35 +1200 Subject: [PATCH] Fixed marmalade dependency loading. In case your marmalade has other dependencies they will be correctly loaded now. Note: Make sure to not publish any other DLLs besides the ones you are sure you will need, as there can be version conflicts which didn't happen before. For example if you have a EllieMarmalade.dll which is a different version in the data/marmalade/mymarmalade folder, your marmalade will now break, as this fix will now (correctly) try to load it and there will be a version mismatch between the attributes. In a future patch i'll try to mitigate this by not loading dlls which are already loaded by the bot (even if their versions are different) but this might cause new issues as sometimes you do need different version of libraries for marmalade... The best option is to just keep what you need, and make sure to remove any other dlls --- .../_common/Marmalade/Common/MarmaladeLoaderService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/EllieBot/_common/Marmalade/Common/MarmaladeLoaderService.cs b/src/EllieBot/_common/Marmalade/Common/MarmaladeLoaderService.cs index a17e05a..1c6dd00 100644 --- a/src/EllieBot/_common/Marmalade/Common/MarmaladeLoaderService.cs +++ b/src/EllieBot/_common/Marmalade/Common/MarmaladeLoaderService.cs @@ -330,9 +330,9 @@ public sealed class MarmaladeLoaderService : IMarmaladeLoaderService, IReadyExec throw new FileNotFoundException($"Marmalade dll not found: {path}"); strings = MarmaladeStrings.CreateDefault(dir); - var ctx = new MarmaladeAssemblyLoadContext(Path.GetDirectoryName(path)!); + var ctx = new MarmaladeAssemblyLoadContext(path); var a = ctx.LoadFromAssemblyPath(Path.GetFullPath(path)); - ctx.LoadDependencies(a); + // ctx.LoadDependencies(a); // load services iocModule = new MarmaladeNinjectIocModule(_cont, a, safeName);