Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ways of scheduling tasks (without writing windows scheduler) in asp.net

I am into shared hosting and they do not allow me to use windows scheduler... So what are the ways of achieving scheduled tasks ie(timed mail) in asp.net... I just saw background process by Jeff Atwood blog... Is it relaible? Or any other ways of doing scheduled tasks...

Then i found quartz.net but i can't find a simple example that embeds quartz.net into an asp.net(without installing a Quartz.Net server as a standalone windows service)... Any suggestion on quartz.net...

like image 940
ACP Avatar asked Jul 14 '10 09:07

ACP


2 Answers

You could simply write an ASP.Net page that performs your task, e.g. sending the mails. Then use an online scheduling service like SetCronJob to call the URL of the page on your server on a schedule.

The downside of this very simple approach is that you are dependent on an external service.

like image 121
Vinz Avatar answered Oct 14 '22 08:10

Vinz


I was investigating Microsoft.Web.Administration assembly Schedule Class to achieve same thing but it seems that class can be used only to schedule IIS worker process restart, here is the example of creating app pools and setting periodical restart.

So only way was to schedule with this was ASP.NET app restart and then in Application_Start do the scheduled work. But that is ugly hack not solution, so at the end I ended up adding scheduling capabilities to our homegrown backup windows service that was allready running on web server, so IMO Quartz.net is the best solution for you. Maybe you could convince your web provider to install Quartz.net all other solutions seems like a hack that will give you more or less problems.

like image 30
Antonio Bakula Avatar answered Oct 14 '22 07:10

Antonio Bakula