mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-01-01 05:13:40 +01:00
Allow plugins to load Dalamud dependency assemblies (#1580)
This commit is contained in:
parent
02b1f6e426
commit
69096c440a
1 changed files with 9 additions and 1 deletions
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright (c) Nate McMaster, Dalamud team.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the Loader root for license information.
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Runtime.Loader;
|
||||
|
||||
|
|
@ -151,6 +151,14 @@ internal class PluginLoader : IDisposable
|
|||
builder.PreferDefaultLoadContextAssembly(assemblyName);
|
||||
}
|
||||
|
||||
// This allows plugins to search for dependencies in the Dalamud directory when their assembly
|
||||
// load would otherwise fail, allowing them to resolve assemblies not already loaded by Dalamud
|
||||
// itself yet.
|
||||
builder.AddProbingPath(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location));
|
||||
|
||||
// Also make sure that plugins do not load their own Dalamud assembly.
|
||||
builder.PreferDefaultLoadContextAssembly(Assembly.GetExecutingAssembly().GetName());
|
||||
|
||||
return builder;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue