how to detect AssemblyLoadContext been gc #111116
-
how to detect AssemblyLoadContext been gc |
Beta Was this translation helpful? Give feedback.
Answered by
huoyaoyuan
Jan 6, 2025
Replies: 1 comment 2 replies
-
Why is it necessary to know when an AssemblyLoadContext instance is being collected? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Unloading
will prevent further usage of the ALC. It will be fully unloaded when all existing usages are dead.You can use a weak reference to the ALC, and check the weak reference when GC happens. Something like this: