I archived the back-end in such a way that the business logic is placed in dlls loaded at runtime. Using ShadowCopyFiles = true and file system monitoring, I can change the business logic without restarting the host process.
So far so good ...
Let us call hostdomaindomain A and one of the children of B.
Unfortunately, if I make changes to the assembly C referenced by B, but not to A, these changes are not reflected when B reboots. I assume that this is because A loads C. What steps should I take to prevent loading C?
This is the code used by A to load B:
AppDomainSetup appDomainSetup = new AppDomainSetup();
appDomainSetup.CachePath = ServiceDLLPath + @"\Shadow";
appDomainSetup.ShadowCopyFiles = "true";
ad = AppDomain.CreateDomain(assemblyName, null, appDomainSetup);
ad.InitializeLifetimeService();
try
{
service = (IService)ad.CreateInstanceFromAndUnwrap(assemblyName,
"AppName.Services." + typeName);
service.Start();
}
catch (Exception e)
{
LogManager.Log("AppDomain load failed: " + e.Message);
return false;
}
source
share