We have an application that consists of a light weight Launcher while most of the functionality is in a dll. The Launcher regularly check for updates and download a new dll if there is one. The new dll is started using code like this (MsqApplication is a dynamic):
MsqAssembly = Assembly.LoadFile("path/msq.dll"));
MsqApplication =
Activator.CreateInstance(MsqAssembly.GetType("Msq.Program"));
MsqApplication.Start();
It works fine except the that we don´t know how to kill the old dll when a new one is started. Is there any good way to do that?