Skip to content

Commit 000bd23

Browse files
committed
Also load PDBs in AssemblyResolve
1 parent 15ff5c3 commit 000bd23

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

TerrariaServerAPI/TerrariaApi.Server/ServerApi.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,8 @@ private static Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEven
519519
Assembly assembly;
520520
if (!loadedAssemblies.TryGetValue(fileName, out assembly))
521521
{
522-
assembly = Assembly.Load(File.ReadAllBytes(path));
522+
var pdbPath = Path.ChangeExtension(fileInfo.FullName, ".pdb");
523+
assembly = Assembly.Load(File.ReadAllBytes(path), File.Exists(pdbPath) ? File.ReadAllBytes(pdbPath) : null);
523524
// We just do this to return a proper error message incase this is a resolved plugin assembly
524525
// referencing an old TerrariaServer version.
525526
if (!InvalidateAssembly(assembly, fileName))

0 commit comments

Comments
 (0)