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?
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.
How is your service installed? What windows Version are you on?
If vista/7 does Interactive services Detection show up?
Bottom line is windows services where never designed for user interaction.
There is a way however, but I would recommend using a different way to interact with the user
Setting a windows service to interact with the desktop could pose a security issue.
I posted this link Hope it helps
http://social.msdn.microsoft.com/Forums/en-US/csharplanguage/thread/1c3d4b96-c58b-465a-a964-89926bd455f1/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With