Issue with AssemblyLoadContext Unload in .NET
MakesYT Liao
0
Reputation points
I am using AssemblyLoadContext in a .NET WPF project (net8.0-windows10.0.19041.0), and I am encountering a strange issue. If I load the DLL in App.cs, I cannot manually unload it later. However, if I load and unload the DLL by pressing a button after the program starts, it can be unloaded correctly. The code for both cases is almost identical. During uninstallation, I also saw a different symptom through WinDbg. Any idea what could be causing this issue?
Symptom seen through WinDbg during uninstallation:
Loading the DLL manually later:
Loading the DLL in App.cs (can't unload):
Developer technologies | Windows Presentation Foundation
Developer technologies | Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
Developer technologies | .NET | Other
Developer technologies | .NET | Other
Microsoft Technologies based on the .NET software framework. Miscellaneous topics that do not fit into specific categories.
Sign in to answer