From f975c561d5e94d519b57935d965a552094384ce4 Mon Sep 17 00:00:00 2001 From: Bart Vries Date: Wed, 27 Mar 2024 14:38:04 +0100 Subject: [PATCH] Changed project to package reference and fixed potential NRE --- src/realtime-session-with-stacks/Program.cs | 9 +++++---- .../realtime-session-with-stacks.csproj | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/realtime-session-with-stacks/Program.cs b/src/realtime-session-with-stacks/Program.cs index e59ecac..3f19451 100644 --- a/src/realtime-session-with-stacks/Program.cs +++ b/src/realtime-session-with-stacks/Program.cs @@ -118,10 +118,11 @@ private static void PrintCallStack(TraceCallStack callStack) // You can do this synchronously by just removing the call to ResolveSymbolsForModule from the Task and calling synchronously. if(string.IsNullOrEmpty(current.CodeAddress.FullMethodName) && !ResolvedSymbolsForModule(current.CodeAddress.ModuleFile)) { - Task.Factory.StartNew(() => - { - ResolveSymbolsForModule(current.CodeAddress.CodeAddresses, current.CodeAddress.ModuleFile); - }); + Task.Factory.StartNew((o) => + { + var localCurrent = (TraceCallStack)o; + ResolveSymbolsForModule(localCurrent.CodeAddress.CodeAddresses, localCurrent.CodeAddress.ModuleFile); + }, current); } Console.WriteLine($"[0x{current.CodeAddress.Address:X}] {current.CodeAddress.ModuleName}!{current.CodeAddress.FullMethodName}"); diff --git a/src/realtime-session-with-stacks/realtime-session-with-stacks.csproj b/src/realtime-session-with-stacks/realtime-session-with-stacks.csproj index 6af4e26..8419b4e 100644 --- a/src/realtime-session-with-stacks/realtime-session-with-stacks.csproj +++ b/src/realtime-session-with-stacks/realtime-session-with-stacks.csproj @@ -1,4 +1,4 @@ - + Exe @@ -7,7 +7,7 @@ - +