.netwindowsscheduled-taskswindows-server

Automatically run program on Windows Server startup


I am trying to create and install a .NET app on a windows server that is always on, but I am running into problems. I have heard that I should not make it a Windows service (and would personally rather have a dialog app so I can see progress, etc) so I am trying to use the task scheduler. However, the task scheduler keeps trying to close my app prematurely, when it should only open it and leave it open.

Any ideas how I could have my dialog app run on startup (and stay running) on my server?


Solution

  • You should make a Windows Service; it's the only reliable way to do this.
    Otherwise, you will run into problems if, for example, the user logs off.

    If you want UI, you can make a separate GUI that communicates with the service (probably using WCF).