Windows Service or Task Scheduler for maintenance tasks?

前端 未结 6 1496
一生所求
一生所求 2020-12-31 22:41

I have a C# Application that does some maintenance tasks. It needs to run roughly every hour, although it\'s not too important if it\'s a bit off. And it has to run on a Win

6条回答
  •  时光说笑
    2020-12-31 23:13

    I think a windows service is probably more reliable and easier to monitor, but it won't offer the same scheduling flexibility as a scheduled task out-of-the-box. I'd probably go with the service anyway, since most enterprisey apps tend to run as services, not scheduled tasks.

    For recent projects, I've used Quartz.NET to setup scheduled processing in windows services. It's actually not too hard to setup (good tutorial), and the CronTrigger will give you a ton of flexibility with only a tiny bit of configuration. I like it better than a raw .NET Timer.

提交回复
热议问题