I have a web application written in asp. Net mvc core 2.2. O need to run a schedule job every day at 3:00 Am. What is the best way to do it?
I tried hangfire it stops after some time. We need to set IIS server always running. I googled and found hosted service in. Net core. Can anyone tell me what is the best approch to run a job daily in web application in dot net core?
We can use Quartz scheduling to perform a job every 5 minutes. To begin, make a project with the ASP.NET core web application template. Choose Asp.net MVC for your online application. There are two ways to install the Quartz package.
For example, you can use pingdom.com free account to call a certain url every <enter time here> period. So in pingdom you can enter the url to your MVC action. And that will be called every 24 hours and your code will run on schedule.
The cron reads the crontab (cron tables) for running predefined scripts. By using a specific syntax, you can configure a cron job to schedule scripts or other commands to run automatically.
I've not personally tried it for .NET Core honestly, but have you tried Quartz Scheduler? https://www.quartz-scheduler.net/
[UPDATE]: According to Quartz GitHub repo: "Quartz.NET supports .NET Core/netstandard 2.0 and .NET Framework 4.6.1 and later."
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