Skip to content

Commit

Permalink
Also load symbols in AssemblyResolve
Browse files Browse the repository at this point in the history
  • Loading branch information
Arthri committed Jun 15, 2023
1 parent 8a3fffd commit e9f66d4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion TerrariaServerAPI/TerrariaApi.Server/ServerApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit e9f66d4

Please sign in to comment.