Hown to unload an assembly loaded via LoadFrom?

  • Thread starter Thread starter Edward Yang
  • Start date Start date
E

Edward Yang

I have a piece of code that loads an assembly (an .exe file) using LoadFrom.
I check the GuiAttribute value and then get a updated version from a
configured URL and try to replace the assembly.

The problem is that Assembly class does not have an Unload method so that
once an assembly is loaded, it is not able to be unloaded manually. I most
of the time got the error that the assembly (.exe) is used by another
process and I could not repalce it with the new version.

I hope anybody can tell me a work-around way to unload a loaded assembly
from memory using code?
 
Back
Top