Skip to content

Commit d0de305

Browse files
Merge branch 'Pryaxis:general-devel' into net9-upgrade
2 parents 123f37c + 1e16a92 commit d0de305

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

TerrariaServerAPI/TerrariaApi.Server/ServerApi.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ public static bool IsWorldRunning
7575

7676
static ServerApi()
7777
{
78+
AppContext.SetSwitch("Switch.System.Diagnostics.StackTrace.ShowILOffsets", true);
7879
Dictionary<string, string> args = Utils.ParseArguements(Environment.GetCommandLineArgs());
7980
Hooks = new HookManager();
8081
LogWriter = new LogWriterManager(enabled: !args.ContainsKey("-nolog"));
@@ -517,7 +518,8 @@ private static Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEven
517518
Assembly assembly;
518519
if (!loadedAssemblies.TryGetValue(fileName, out assembly))
519520
{
520-
assembly = Assembly.Load(File.ReadAllBytes(path));
521+
var pdbPath = Path.ChangeExtension(fileName, ".pdb");
522+
assembly = Assembly.Load(File.ReadAllBytes(path), File.Exists(pdbPath) ? File.ReadAllBytes(pdbPath) : null);
521523
// We just do this to return a proper error message incase this is a resolved plugin assembly
522524
// referencing an old TerrariaServer version.
523525
if (!InvalidateAssembly(assembly, fileName))

0 commit comments

Comments
 (0)