While this is done in a web application, this is not ideal. this is achievable , given that the site is always up.
Here is an example: I create a Cache element in global.asax with an expiration date. After this period, dismissal occurs. You can receive data or something else in the OnRemove () event.
You can then set up a page call (preferably a very small one) that calls the code in Application_BeginRequest, which will add an expired cache element.
global.asax:
private const string VendorNotificationCacheKey = "VendorNotification"; private const int IntervalInMinutes = 60;
This works well if the scheduled task is fast. If this is a long process, you definitely need not to use it in your web application.
Until the first request launches the application ... it will continue every 60 minutes, even if there are no visitors on it.
source share