title: How do I run an Azure WebJob locally?
body: <p>I want to create a continuously running WebJob but first I want to try and run it locally for debugging. I am using Visual Studio 2015 and I have the Azure storage emulator running (I can run the sample for Azure WebJobs in visual studio). </p>
  
  <p>When I run the below it fails on the <code>new JobHost()</code> line with:  </p>
  
  <blockquote>
    <p>Exception: Value cannot be null. Parameter name: method</p>
  </blockquote>
  
  <pre><code>    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));
          }
      }
  </code></pre>
  
  <p>Can I even run the continous running jobs locally?</p>