Unloading and replacing an assembly

  • Thread starter Thread starter Jonas Bergman
  • Start date Start date
J

Jonas Bergman

I have an application that dynamically loads an assembly dureing runtime. I
want to send a mesage to the application that a new version of the assembly
is available.

I then want to unload the assembly and replace the existing file with a new
file with the same name, without exiting the application.

Is that possible??

/Jonas Bergman
 
Why dont you code your application to look for another file name as the
replacement assembly at regualr intervals, and when it finds the file
delete/rename the old assembly and rename the new one to the old file name.
 
Hello Jonas,
I have an application that dynamically loads an assembly dureing
runtime. I want to send a mesage to the application that a new version
of the assembly is available.

I then want to unload the assembly and replace the existing file with
a new file with the same name, without exiting the application.

Is that possible??

/Jonas Bergman

The assembly would have to be loaded into a different appdomain and treated
with care. If you bring the assembly into your main appdomain you can't unload
it without exiting the application instance.
 
The problem is that the assembly is loaded in to the application (the
AppDomain??) and that I can't delete a file that has been used in the
application,. The file is locked.
 
Back
Top