My project calls a (non-referenced) DLL project with UI. The end user is supposed to close this form before closing the main form (main project) but sometimes they do not.
I tried using AppDomain.GetAssemblies() to see if the DLL Form is closed. However, even when I close the DLL form, it still shows in the GetAssemblies list. My guess is it remains in the memory until some point?!
What is the best practice to ensure all loaded DLLS from the main project are unloaded and released in memory before allowing the closure of my main project?