Reputation: 60731
i will have a c# application that will get data from a timeclock and send an email to every employee biweekly.
what are the advantages to having the application automatically run as a service?
Upvotes: 2
Views: 761
Reputation: 56391
I think you answered your own question.
If your application runs automatically as a service, it will start itself whenever the server starts. It can then periodically check the time to determine if it's supposed to execute whatever its job might be.
The key benefit is that it runs automatically, without having to task Bill (or whomever) with the job of loading the program and twiddling his thumbs while it executes.
Upvotes: 1
Reputation: 564413
It doesn't require a user to be logged in, and can be configured to run under an account/permission set of your choice. Applications, such as this one (from the description), which are meant to be "always-on" tend to make the most sense as a service.
However, if you are doing something that will run biweekly, you might also want to consider a console application running as a scheduled task. This has the advantage of allowing the app to be run as needed, and not stay resident in memory. This is better in terms of system resource utilization. It also makes "reconfiguration" of the schedule very easy, since it requires no change in the application itself.
Upvotes: 13
Reputation: 120450
Upvotes: 1
Reputation: 53861
If it is run as a service, no user has to be logged in, it can auto restart and runs as SYSTEM with full privileges to the system.
Upvotes: 1
Reputation: 754468
Upvotes: 3