I'm looking for a C# library, preferably open source, that will let me schedule tasks with a fair amount of flexibility. Specifically, I should be able to schedule things to run every N units of time as well as "Every weekday at XXXX time" or "Every Monday at XXXX time". More features than that would be nice, but not necessary. This is something I want to use in an Azure WorkerRole, which immediately rules out Windows Scheduled Tasks, "at", "Cron", and any third party app that requires installation and/or a GUI to operate. I'm looking for a library.
-
1Check out the natively available Azure Scheduler, introduced in 2014 - http://azure.microsoft.com/en-us/services/scheduler/ – mvark Jun 22 '14 at 14:21
6 Answers
http://quartznet.sourceforge.net/
"Quartz.NET is a port of very propular(sic!) open source Java job scheduling framework, Quartz."
PS: Word to the wise, don't try to just navigate to quartz.net when at work ;-)

- 3,663
- 1
- 24
- 25
-
is quartz.net uses windows scheduler or timers for scheduling? – Arsen Mkrtchyan Dec 14 '12 at 15:30
-
1
-
1It has serious bug, if you have 20 tasks and 5 threads in pool, it exequtes first few tasks more frequently and latst tsks are bein exequted only once per few minutes instead of once every 15 sec as I've asked. And as @michael-sync mentioned, it don't support async/await. – Bogdan Mart Sep 06 '15 at 23:33
-
5If you are here in 2017, then use HangFire. http://hangfire.io/ HangFire's an easy way to perform scheduled tasks and background processing in .NET and .NET Core applications. No Windows Service or separate process required. Also comes with a beautiful dashboard UI out of the box. Backed by persistent storage. Open and free for commercial use. Related SO Q&A : http://stackoverflow.com/q/27875631/325521 – Shiva Feb 06 '17 at 22:14
I used Quartz back in my Java days and it worked great. I am now using it for some .Net work and it works even better (of course there are a number of years in there for it to have stabalized). So I certainly second the recommendations for it.
Another interesting thing you should look at, that I have just begun to play with is the new System.Threading.Tasks in .Net 4.0. I've just been using the tasks for parallelizing work and it takes great advantage of multi cores/processors. I noticed that there is a class in there named TaskScheduler, I haven't looked at it in detail, but it has methods like QueueTask, DeQueTask, etc. Might be worth some investigation at least.

- 923
- 4
- 12
- 24
See A New Task Scheduler Class Library for .NET on Codeproject.

- 41,475
- 16
- 112
- 158
-
Like this more then quartz, but need to know, if it's will be long supported lib. Enterprise reasons. – Johnny_D May 18 '12 at 12:57
I read about Quartz in this question How might I schedule a C# Windows Service to perform a task daily?. It's a C# library and allows for flexible scheduling.
Quartz seems like a nice solution.
I've recently (this year) had to write a custom task scheduler on a major project I was working on. They too could not use the Windows Task Scheduler, and also wanted the ability to execute custom functionality by virtue of uploading assemblies (via an ASP.net website) and have the service execute the appropriate task at the specified time.
The thing was honestly a bit of a nightmare (not so much to design and implement, but the scheduling logic was a bit of a drag).
I'd highly recommend exhausting all other avenues before deciding to "roll your own" (a.k.a reinvent the wheel!).

- 57,123
- 20
- 76
- 103

- 9,382
- 3
- 35
- 63
There is a new cloud based scheduler from Aditi Technologies called Scheduler.
Scheduler allows developers to schedule the execution of tasks through HTTP webhooks that run on simple or complex CRON schedules.

- 15,928
- 7
- 71
- 92