Dynamically loading plugins

  • Thread starter Thread starter Casper Hornstrup
  • Start date Start date
C

Casper Hornstrup

I need to create a system that will detect when an assembly (the plugin) is
copied into a directory.
When the system (a webservice) detects a new version of the plugin it needs
to unload the previous
version and load and execute the new version instead. I've got the
reflection part figured out, but I'm
not sure how to handle the assembly-in-use problem. How would you handle
such a situation?

Casper Hornstrup
 
Create an appdomain and run the plugin from that appdomain. When you want to
update the dll, unload the appdomain (which unloads the DLL), copy the new
bits, and repeat (create an appdomain, etc).
 
Thanks Dave, I'll try that.

Dave said:
Create an appdomain and run the plugin from that appdomain. When you want to
update the dll, unload the appdomain (which unloads the DLL), copy the new
bits, and repeat (create an appdomain, etc).
 
Back
Top