I am trying to run an Exe on start of window service . In development mode it triggers exe and UI is visible once triggered . But after windows service installed , i am not seeing the UI but exe is running as background process. How to make UI visible for the tiggered exe from windows service.
Asked
Active
Viewed 180 times
-2
-
1Does this answer your question? [How can I run an EXE program from a Windows Service using C#?](https://stackoverflow.com/questions/5307968/how-can-i-run-an-exe-program-from-a-windows-service-using-c) – gunr2171 May 10 '22 at 20:46
-
3I think you need to read the first answer on that linked question. The answer is you cannot do what you're asking. You need to make a service that can be communicated with, and a client app. Two separate executables. – Logarr May 10 '22 at 21:07
-
1Does this answer your question? [C# Windows Service with GUI](https://stackoverflow.com/questions/40305093/c-sharp-windows-service-with-gui) – Ray May 10 '22 at 22:09
1 Answers
0
Services do not display a user interface directly due to Session 0 isolation. So you'll need to rethink with a client-server-style separation of service processing from user interface.
The user-mode UI process will start when the user logs in and remain largely idle/hidden. It will establish an inter-process communication connection to the service and await orders in client-server fashion. If the server wants to "push" some kind of an alert to the client, it does so by notifying the user-mode application to display the user interface on its behalf.

Wyck
- 10,311
- 6
- 39
- 60