I want to create a continuous website, but first I want to try to run it locally first for debugging. I am using Visual Studio 2015 and my azure storage emulator is working (I can run the sample for azure webjobs in visual studio). When I run this, it does not work on the new line JobHost ().
Exception: value cannot be null. Parameter Name: Method
static void Main() { var host = new JobHost(); host.CallAsync(typeof(Functions).GetMethod("GetNextJob")); // The following code ensures that the WebJob will be running continuously host.RunAndBlock(); } [NoAutomaticTriggerAttribute] public static async Task GetNextJob() { while(true) { try { var log = new Logger(); log.WriteInfo("Getting next job to be run", 0, 0, "Brain"); //Console.WriteLine("Getting new Job and putting to que"); } catch(Exception ex) { Console.WriteLine(ex.Message); } await Task.Delay(TimeSpan.FromSeconds(5)); } }
Is it possible to run local work tasks on an ongoing basis?
source share