Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to schedule a task in MVC4 C#?

Tags:

I wanna create a notification system on my website?(something like stack-overflow)
How can we schedule a task for mailing the notification for users on each 24 hours?

Can we use MVC4 or we should use windows service ?

Edit:
My Experience with using FluentScheduler in 3 month within a MVC4 App .
FluentScheduler is easy to config and using but it doesn't run tasks any time. Sometimes run and sometimes doesn't run.
I think the best way for scheduling is Windows Service to ensure running a task at the specific time.

like image 419
Mohammad Dayyan Avatar asked Jan 31 '13 07:01

Mohammad Dayyan


People also ask

How to use Quartz scheduler in asp net mvc?

First create a application and install Quartz.NET in our application is via Nuget , We can do this by typing Install-Package Quartz at the Package Manager Console prompt or by right clicking on the project in Visual Studio Solution Explorer and select Manage Nuget Packages.


1 Answers

Found this to be an awesome scheduler, FluentScheduler

Usage:

// Schedule an ITask to run at an interval     Schedule<MyTask>().ToRunNow().AndEvery(2).Seconds(); 
like image 70
heads5150 Avatar answered Nov 10 '22 08:11

heads5150