2

I have a function that I would like to have called every day at 11:59 PM. The console application will be running 24/7.

My first thought was to have a timer run every minutes and check if it is 11 59 PM, but I am wondering if .Net has a better way.

Thanks

jmasterx
  • 47,653
  • 87
  • 281
  • 523

3 Answers3

6

Console app + Windows scheduled task is the simplest solution.

For a more complex scheduling needs look into Quartz.NET.

Jakub Konecki
  • 44,070
  • 6
  • 84
  • 125
1

You should use the Windows Service to make this happen automatically. This service should be registered in the services. The windows Service Controller Manager has the timer option to trigger the automatically on particular time.

Smaug
  • 2,505
  • 4
  • 26
  • 42
0

Here is the snapshot of the task scheduler, create your console application with some arugments, and then add a task there.

enter image description here

David
  • 14,646
  • 22
  • 52
  • 64