0

I've watched this tutorial where it explains how a console project can be deployed as a Windows Task.

My question is if I create console project with a IHost and a couple of hosted services running some logic in a loop while the token is not stopped (i.e. inside a loop) and I deploy this executable as a Task scheduling it to run once when the computer starts, what would be the difference between this way of running the executable and, by other hand, create a worker service project with the same previously hosted services and deploy this project as a Windows Service to execute automatically when the machine starts?

Marlonchosky
  • 494
  • 5
  • 16
  • https://stackoverflow.com/questions/390307/windows-service-vs-scheduled-task, https://stackoverflow.com/questions/507674/scheduled-console-app-vs-windows-service-when-is-it-appropriate-to-use-each, https://stackoverflow.com/questions/47678529/which-is-better-a-scheduled-task-or-windows-service, https://stackoverflow.com/questions/503564/how-might-i-schedule-a-c-sharp-windows-service-to-perform-a-task-daily, https://stackoverflow.com/questions/2811653/scheduled-task-or-windows-service, https://softwareengineering.stackexchange.com/questions/6190/windows-service-or-windows-task-scheduler – CodeCaster Jul 10 '23 at 14:54
  • 3
    To make it short, they are technically similar, but services are supposed to always run and can be controlled by the service controller (sc.exe is the tool), scheduled tasks are not. If I see a scheduled task that runs continuously, it will appear suspect to me. Historically, Windows (NT) on day 1 had only services and the "at" command for scheduled tasks (which is now deprecated). – Simon Mourier Jul 12 '23 at 06:23

0 Answers0