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?
config.Tracing.ConsoleLevel
– mathewcconfig.Tracing.ConsoleLevel = System.Diagnostics.TraceLevel.Verbose;
And it return this : "The next 5 occurrences of the schedule will be: 1/8/2016 8:00:00 PM" However the method never run – srd98