user1769189
user1769189

Reputation: 31

Unload DLL from Memory

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.

Upvotes: 3

Views: 2726

Answers (2)

jags
jags

Reputation: 2070

A shared DLL loaded in domain neutral manner cannot be unloaded unless the Process is exited. Domain specific DLLs are unloaded alongwith Domain. There is however no way to unload individual DLLs even if the DLL has been loaded for reflection only.

Upvotes: 0

Science_Fiction
Science_Fiction

Reputation: 3433

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

Upvotes: 1

Related Questions