Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unload DLL from Memory

Tags:

c#

.net

memory

dll

How can I unload a DLL from memory that belongs to another process, or the process had ended but the DLL is still loaded into memory?

I know how to find an existing process and even list all the loaded DLL's for that, but what I can't seem to get is how to find loaded DLL's and unload them from memory.

Everything I've read talks about AppDomains, but I'm not sure if this case would apply or not to that method since I want to close DLL's that aren't called by my app.

Any help would be appreciated.

like image 527
user1769189 Avatar asked Sep 03 '26 08:09

user1769189


1 Answers

I don't think you can unload a single assembly. But you can unload an AppDomain that contains the assembly.

like image 175
Science_Fiction Avatar answered Sep 05 '26 21:09

Science_Fiction