There is a service (written in C #) that manages several threads.
It is necessary to transfer the utility functionality (implemented in a separate C # application) to the service, but there is no desire to produce services.

Question : Is it possible to combine several services in one exe , and if so, how to install them?

PS : I would appreciate examples and useful links.

  • Well, here I have written several service classes and installer classes. Whether such an entry in Program.cs will be correct: ServiceBase [] ServicesToRun; ServicesToRun = new ServiceBase [] {new WindowsService ()}; ServiceBase.Run (ServicesToRun); - t1nk

1 answer 1

The executable file may contain several services, and for each service in this file there must be a separate ServiceInstaller object. An instance of ServiceInstaller registers a service in the system. In addition, an event log is associated with each service in which service commands are written. The services to be started are determined by the main () function of the executable file. The current working folder of the service is the system folder, but not the folder where the executable file is located.

Source: MSDN material .

Look here: placing multiple services in one process .