Are there any good frameworks or templates for developing Windows Services? I generally don't write windows services and hoping someone has shared their expertise via an api or example project.
I am working on a project with the following requirements:
UPDATE
marc_s answer reminded me of this 2005 Visual Studio Magazine article by Luther Miller that I read.
I know this is an old question, but for the occasional Googler coming across this, as I have:
Topshelf is a nice Windows Services framework.
Creating Windows Services using the standard Windows Service Template in Visual Studio is simple enough, you don't really need any special framework. However, in VS Express you may not have the winservice template and then Topshelf makes it quite easy using the Windows -> Console Application project template.
There is no single framework that will provide all the requirements listed in the original question, but here are some suggestions:
- many independently scheduled tasks
- allows adding/removal of tasks
- allows changing of schedules
You're probably pretty much on your own here, but it's easy enough to accomplish with timer(s) and simple configuration in your App.config. Or, if you want to be fancy, using dependency injection or a plugin mechanism, maybe using MEF.
- reports on the success or failure of these tasks via email/log/sms/??
Look at log4net or NLog. Topshelf has support for both.
(Having used Windows Workflow Foundation (WF), I'm not convinced at all by the WF-related answers to this question. I would appreciate if anyone is able to provide references to reputable sample apps that show how WF could possibly address any of these requirements in the original question.)
I make no promises, but this sounds like a candidate for using Windows Workflow Foundation.
If it is a scheduler kind of thing that you are looking for, then you may want to look at Quartz.net. This is an open source job scheduling system. It would be easier to use an existing tool rather than rewriting one from scratch (unless it is for academic purposes).
In terms of software, there's no need for anything other than the .NET base class library.
I found this two-part article very useful and enlightening, especially considering your requirement to "performs 1..many independently scheduled tasks....":
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With