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

This commit is contained in:
Toastie (DCS Team) 2024-09-22 14:24:35 +12:00
parent 8ec4e6cbb0
commit 3195377e25
Signed by: toastie_t0ast
GPG key ID: 27F3B6855AFD40A4

View file

@ -330,9 +330,9 @@ public sealed class MarmaladeLoaderService : IMarmaladeLoaderService, IReadyExec
throw new FileNotFoundException($"Marmalade dll not found: {path}"); throw new FileNotFoundException($"Marmalade dll not found: {path}");
strings = MarmaladeStrings.CreateDefault(dir); strings = MarmaladeStrings.CreateDefault(dir);
var ctx = new MarmaladeAssemblyLoadContext(Path.GetDirectoryName(path)!); var ctx = new MarmaladeAssemblyLoadContext(path);
var a = ctx.LoadFromAssemblyPath(Path.GetFullPath(path)); var a = ctx.LoadFromAssemblyPath(Path.GetFullPath(path));
ctx.LoadDependencies(a); // ctx.LoadDependencies(a);
// load services // load services
iocModule = new MarmaladeNinjectIocModule(_cont, a, safeName); iocModule = new MarmaladeNinjectIocModule(_cont, a, safeName);