Release DLL from memory

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I've loaded a DLL in memory (object.createinstance). How can I unload it from
memory again? When I set the handle to nothing the DLL stays active (that is,
it's internal routines are still executing).
 
You can't unload a DLL from an AppDomain that has used any of the DLLs types.
You have load the DLL and use it's types in a separate DLL then unload the
AppDomain. The usual scenario for doing this is called sandboxing. the .NET
Security blog [1] has lots of detail about doing this.

[1] http://blogs.msdn.com/shawnfa/
 
Back
Top