Click here to Skip to main content
14,391,900 members
Rate this:
Please Sign up or sign in to vote.
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 1:16am
Rate this:
Please Sign up or sign in to vote.

Solution 2

What's wrong with Windows Task Scheduler?
   
Comments
RickZeeland 3-Dec-19 7:52am
   
Nothing :)
Rate this:
Please Sign up or sign in to vote.

Solution 1

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[^]
   
v2

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




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100