Merge pull request #2688 from Pryaxis/dependency_base_path

Fix #2674 - Change the use of current directory to match the server a…
This commit is contained in:
Lucas Nicodemus 2022-10-07 01:47:52 -07:00 committed by GitHub
commit c875168640
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View file

@ -24,6 +24,7 @@ This is the rolling changelog for TShock for Terraria. Use past tense when addin
* SetDefaultsEventArgs now includes a nullable ItemVariant instance. (@SignatureBeef)
* Use a string interpolation and escape single quotes when escaping tables (@drunderscore)
* Removed obsolete resource files `TShockAPI/Resources.resx` and `TShockAPI/Resources.Designer.cs`. (@Arthri)
* Plugins and ./bin dependencies are now loaded relative to the launcher, this improves the use of startup files (@SignatureBeef)
## TShock 4.5.18
* Fixed `TSPlayer.GiveItem` not working if the player is in lava. (@gohjoseph)

View file

@ -42,7 +42,7 @@ Assembly? Default_Resolving(System.Runtime.Loader.AssemblyLoadContext arg1, Asse
if (arg2?.Name is null) return null;
if (_cache.TryGetValue(arg2.Name, out Assembly? asm) && asm is not null) return asm;
var loc = Path.Combine(Environment.CurrentDirectory, "bin", arg2.Name + ".dll");
var loc = Path.Combine(AppContext.BaseDirectory, "bin", arg2.Name + ".dll");
if (File.Exists(loc))
asm = arg1.LoadFromAssemblyPath(loc);