What is the equivalent to cron jobs in ASP.NET?

Another option is to use hangfire which says about itself

An easy way to perform background processing in .NET and .NET Core applications. No Windows Service or separate process required.

Backed by persistent storage. Open and free for commercial use.

Requirements (as of November 2019) are

  • .NET Framework 4.5
  • Persistent storage, e.g. an SQL database where Hangfire will write 10 tables
  • Newtonsoft.Json library ≥ 5.0.1

Assuming that you have already some API project which runs as service, you can use hangfire within.

Disclaimer: I am not affiliated in any kind with hangfire, I will just be using it soon.


Try Quartz.NET. It's a decent .NET scheduler which supports CRON expressions, CRON triggers and various other means and methods to schedule tasks to be performed at certain times / intervals.

It even includes a basic Quartz.NET server (Windows Application) that might fit your needs.

Edit:

If you can't run applications or windows services within your shared hosting then perhaps something like "Easy Background Tasks in ASP.NET" will do you? It simulates a Windows Service using HttpRuntime.Cache and removes the need for any external dependancies.


This is absolutely a hack, but you can simulate a cron service using ASP.NET callbacks. Here is an example of how to do it.


nCron is a .Net implementation of CRON using nCronTabs which are the exact same as cron scheduling