Click here to Skip to main content
15,883,901 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I want to schedule a work service in .net core to run every 5 minutes. how can i do it?

Thanks
Shweta

What I have tried:

I am using the standard function for task await...
Posted
Updated 3-Dec-19 0:16am

What's wrong with Windows Task Scheduler?
 
Share this answer
 
Comments
RickZeeland 3-Dec-19 7:52am    
Nothing :)
You can do that with a Timer and a Task, see second example here: c# - How to run BackgroundService on a timer in ASP.NET Core 2.1 - Stack Overflow[^]
The question is about ASP.NET Core, but the example is almost plain C# code.

As Pallini suggested, an alternative would be to use the Task Scheduler Library: A New Task Scheduler Class Library for .NET[^]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900