I'm trying to run WebJob as a console app, It works When I add RunOnStartup = true
, but I need that it works just with TimerTrigger.
this is my code
public static void Main()
{
JobHostConfiguration config = new JobHostConfiguration();
config.UseTimers();
JobHost host = new JobHost(config);
host.RunAndBlock();
}
public static void TimerJob([TimerTrigger("0 0 8 * * *")] TimerInfo timerInfo)
{
Console.WriteLine("Job Work");
}
What do I need to make this code work?