Open a dialog window from a windows service
.net, c#, service, windows
Solution
Services run in session 0 which is isolated from the interactive desktop. You cannot show UI from a service. You need to run a separate desktop process to show the UI and then use IPC to communicate between the service and the desktop process.
If your dialog is simple enough you could possibly use WTSSendMessage.
If you want to run code at regular intervals then you may be better off with a scheduled task rather than a service.
Problem
I have created a windows service application in C# to popup a dialog window at particular intervals. While debugging in Visual studio, it is working well. Then I created an installation setup. But after installing the service is not firing to popup the dialog window. What will be the reason and how can I fix it?