From e9f66d409627e880d01c5c7382d35a0c813d89fc Mon Sep 17 00:00:00 2001 From: Arthri <41360489+a@users.noreply.github.com> Date: Thu, 15 Jun 2023 12:09:38 +0000 Subject: [PATCH] Also load symbols in AssemblyResolve --- TerrariaServerAPI/TerrariaApi.Server/ServerApi.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/TerrariaServerAPI/TerrariaApi.Server/ServerApi.cs b/TerrariaServerAPI/TerrariaApi.Server/ServerApi.cs index 233c1899..a0499c5d 100644 --- a/TerrariaServerAPI/TerrariaApi.Server/ServerApi.cs +++ b/TerrariaServerAPI/TerrariaApi.Server/ServerApi.cs @@ -517,7 +517,8 @@ private static Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEven Assembly assembly; if (!loadedAssemblies.TryGetValue(fileName, out assembly)) { - assembly = Assembly.Load(File.ReadAllBytes(path)); + var pdbPath = Path.ChangeExtension(fileName, ".pdb"); + assembly = Assembly.Load(File.ReadAllBytes(path), File.Exists(pdbPath) ? File.ReadAllBytes(pdbPath) : null); // We just do this to return a proper error message incase this is a resolved plugin assembly // referencing an old TerrariaServer version. if (!InvalidateAssembly(assembly, fileName))