Let me explain the scenario first.
I have installed multiple copies (Say 10) of Services from a single install base. Now I want to update one of the dll. I need to Stop all the services, update the dll and restart the Service again.
To avoid the situation, I used ShadowCopying in code. So that the dlls can be updated without stopping all the services. It is as follows.
static void Main(string[] args)
{
AppDomain.CurrentDomain.SetCachePath(@"C:\Cache");
AppDomain.CurrentDomain.SetShadowCopyPath(AppDomain.CurrentDomain.BaseDirectory);
AppDomain.CurrentDomain.SetShadowCopyFiles();
ServiceBase[] ServicesToRun;
ServicesToRun = new ServiceBase[]
{
new SampleService(serviceName)
};
ServiceBase.Run(ServicesToRun);
}
Now I am trying to achieve the same via app.config file, as follows, from Asp.Net
<hostingEnvironment
idleTimeout="Infinite"
shutdownTimeout="30"
shadowCopyBinAssemblies="true" />
Any suggestions?