Share via

Background service

essamce 621 Reputation points
2023-10-19T19:57:38.3833333+00:00

Hi,

For a desktop application How to make a baground service that automatically calls some method Foo every x seconds

Developer technologies | .NET | Other
Developer technologies | C#
Developer technologies | C#

An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.


1 answer

Sort by: Most helpful
  1. Karen Payne MVP 35,606 Reputation points Volunteer Moderator
    2023-10-19T22:24:53.97+00:00

    Check out FluentScheduler.

    NuGet package

    In the following sample replace Console.WriteLine with a call to a method in a class.

    JobManager.AddJob(() => Console.WriteLine("Late job!"), (s) => s.ToRunEvery(5).Seconds());
    

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.