Windows Service : More than one user Service running within the same process
-
Hi, I am working on a windows service that monitor a path and does some upload based on the FileWatcher class. As per microsoft, it say that "More than one user Service may run within the same process". Therefore, i created two services (component classes) in my windows service project and added an instance of each to the service to run as shown below: static void Main() { ServiceUtility initUtl = new ServiceUtility(Constants System.ServiceProcess.ServiceBase[] ServicesToRun; **ServicesToRun = new System.ServiceProcess.ServiceBase[] { new exchangeRateFileWatcher(), new KYCFileWatcher() };**System.ServiceProcess.ServiceBase.Run(ServicesToRun); } However, i read that the second service will run only if the first one fails. Can you please tell me whether it is possible (and how) to run the two services within the same process (i.e exe)? Thank you for your kind help
Carpe diem, Krg
-
Hi, I am working on a windows service that monitor a path and does some upload based on the FileWatcher class. As per microsoft, it say that "More than one user Service may run within the same process". Therefore, i created two services (component classes) in my windows service project and added an instance of each to the service to run as shown below: static void Main() { ServiceUtility initUtl = new ServiceUtility(Constants System.ServiceProcess.ServiceBase[] ServicesToRun; **ServicesToRun = new System.ServiceProcess.ServiceBase[] { new exchangeRateFileWatcher(), new KYCFileWatcher() };**System.ServiceProcess.ServiceBase.Run(ServicesToRun); } However, i read that the second service will run only if the first one fails. Can you please tell me whether it is possible (and how) to run the two services within the same process (i.e exe)? Thank you for your kind help
Carpe diem, Krg
datastruct wrote:
i read that the second service will run only if the first one fails
That's nonsense. I have service processes running up to eight Services.
-
Hi, I am working on a windows service that monitor a path and does some upload based on the FileWatcher class. As per microsoft, it say that "More than one user Service may run within the same process". Therefore, i created two services (component classes) in my windows service project and added an instance of each to the service to run as shown below: static void Main() { ServiceUtility initUtl = new ServiceUtility(Constants System.ServiceProcess.ServiceBase[] ServicesToRun; **ServicesToRun = new System.ServiceProcess.ServiceBase[] { new exchangeRateFileWatcher(), new KYCFileWatcher() };**System.ServiceProcess.ServiceBase.Run(ServicesToRun); } However, i read that the second service will run only if the first one fails. Can you please tell me whether it is possible (and how) to run the two services within the same process (i.e exe)? Thank you for your kind help
Carpe diem, Krg
To start multiple services you have to call the SCM multiple times say by the Services applet . Check out this link . http://forums.msdn.microsoft.com/en-US/csharpgeneral/thread/a062b1e8-7425-4ba9-b038-a5973fd2150d[^]
Vikas Amin
My First Article on CP" Virtual Serail Port "[^]
modified on Thursday, July 24, 2008 5:33 PM
-
To start multiple services you have to call the SCM multiple times say by the Services applet . Check out this link . http://forums.msdn.microsoft.com/en-US/csharpgeneral/thread/a062b1e8-7425-4ba9-b038-a5973fd2150d[^]
Vikas Amin
My First Article on CP" Virtual Serail Port "[^]
modified on Thursday, July 24, 2008 5:33 PM
Thanks for your kind help Vikas :-) I'll see into it now itself
Carpe diem, Krg