Hitting a breakpoint in a async task causes my AssemblyLoadContexts to not unload
Hi, I have this method:
Whenever I I place a breakpoint after the await, it fails to unload the AssemblyLoadContext on next hot reload that this method is in. It's like the debugger keeps a hard reference around. Any tips on how to debug this? 😄
Everything I allocate in the async is confirmed to be disposed. I just allocate a weak reference to a delegate for a callback
4 Replies
Unknown User•5w ago
Message Not Public
Sign In & Join Server To View
It’s not dotnet’s hot reload
It’s my own, the AssemblyLoadContext has issues unloading after the breakpoint with async
can you try detaching the debugger after hitting the breakpoint, and seeing if the old ALC is still rooted
if it is still the case, i would attach with the SOS plugin and use https://learn.microsoft.com/en-us/dotnet/standard/assembly/unloadability#debug-unloading-issues to see where the root is
Yea, if I do that it unloads as normal
I’ll check that link