You are using the library incorrectly - you should not create a new one Schedule.
You must use the method that is inside Registry.
public class MyRegistry : Registry
{
public MyRegistry()
{
Action someMethod = new Action(() =>
{
Console.WriteLine("Timed Task - Will run now");
});
this.Schedule(someMethod).ToRunNow();
}
}
The second problem is that the console application will exit immediately after initialization, so add Console.ReadLine()
static void Main(string[] args)
{
JobManager.Initialize(new MyRegistry());
Console.ReadLine();
}
source
share