I have a windows project that runs queries from a database and generates a bunch of emails. I want to run this weekly through the windows scheduler. What is the best way to set this up?
I am looking in visual studio on how to set this up . .
Should I create a console app? a windows service ? I only have a few tasks that I want to run once a week so I don’t think i want to have it running all the time . . based on that(and articles like this) it seems like a windows service is not what I want. Any other suggestion for the best way to set this up.
My guess is that I would start up the app with some argument which will tell it which function to run but besides that I am not sure what the best practice is here. I assume the scheduler will kick off the job and then shut down but it seems like a windows service is always running ..
For your purposes, you can just create a console app. And yes, just pass the arguments from the task scheduler to the program.
A windows service would probably be overkill, but if the schedule becomes more frequent you can easily switch to a windows service later.