We have a website where we need a scheduler to receive notifications (e-mail) on specific time. eg. a person setting reminder at 5 PM to attend the meeting at 4:45 PM, will receive email at 4:45 PM about same.
As this site is hosted on shared server, we don't have any control over the server to run any SQL Job or scheduler application.
Is there anything in asp.net which can help in this scenario?
The ASP.NET Web Forms Scheduler control is an event calendar that facilitates almost all basic Outlook and Google Calendar features. It allows the user to plan and manage appointments efficiently.
A cron job is a Linux command used for scheduling tasks to be executed sometime in the future. This is normally used to schedule a job that is executed periodically – for example, to send out a notice every morning. Some scripts, such as Drupal and WHMCS may require you to set up cron jobs to perform certain functions.
Probably the best option is self-hosted WCF which will allow you to serve a web-service and to run some background thread. Simplest options looks like a some command like, to be run by Task Scheduler often enough (once a minute?).
You need to have a job done at the server, but you have no good way of triggering it from ASP.NET?
How about creating a webpage that will start your job, and have a timer run elsewhere (ie. on another computer) that requests that page. (Just hitting the page to trigger you jobs)
I had the same problem as you and I ended up with a programming a service that utilize Quartz.NET: http://quartznet.sourceforge.net/ and connect to the same database as the website.
With ASP.NET you are not guaranteed that your app is alive at all times, and thus web applications as a host process for a scheduling solution is not feasible IMO.
A Windows service is what you need for this scenario. You have full control on starting and stopping the process as well as ways of monitoring the application.
Are you able to host such a service on a different machine? Even if the web application is running on a hosted server doesn't mean you have to run the scheduler on the same server.
How about this: Simulate a Windows Service using ASP.NET to run scheduled jobs.
At one point this technique was used on Stack Overflow, although I don't think it is any more.
To be honest it seems like a nasty, error-prone hack to me, but if you're unable to run anything on the server except your website then something like this is probably your only option.
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