I\'m trying to create a task scheduler that runs twice a day. I\'ve implemented a task scheduler using CacheItemRemovedCallaback, as suggested in this post and this blog. I
I found solutions that mention Windows services or Windows task scheduler
That's what you should be using. A web application doesn't "always run." It responds to requests, that's all. Unless something is actively making a request to the website, it's not doing anything.
but that doesn't work for me since I need to be able to let the admin configure the times through the web application
Sure it does. More than one application can share a single database. In this case you'd have two applications:
Using hacks like Windows Scheduled Tasks and Control Panel abilities are not nice solutions. They sucks most of the time, they are a headache.
You can use ATrigger scheduling service. A .Net library is also available to create scheduled tasks without overhead.
//Tags: Tags are required to identify tasks.
//read more at: http://atrigger.com/docs/wiki/9/rest-api-v10-parameter-tag_
Dictionary<string, string> tags = new Dictionary<string, string>();
tags.Add("type", "test");
//Create
ATrigger.Client.doCreate(TimeQuantity.Hour(), "12", "http://www.example.com/myTask?something", tags);
Disclaimer: I was among the ATrigger team. It's a freeware and I have not any commercial purpose.