title: What is the correct syntax for Task.Factory.StartNew?
body: <p>I am trying to start a new thread in VB.NET and I'm having syntax problems.</p>
  
  <p>In C# this is how we can do the same task using:</p>
  
  <pre><code>var manualResetEvent = new ManualResetEvent(false);
  waitHandles.Add(manualResetEvent);
  var taskOne = Task.Factory.StartNew(() =&gt; new Thread(TaskToRun).Start(manualResetEvent));
  taskOne.Wait();
  </code></pre>
  
  <p><code>TaskToRun</code> is a void method with a single object parameter.</p>
  
  <p>All online converters generate VB.NET code similar to this:</p>
  
  <pre><code>Dim manualResetEvent = New ManualResetEvent(False)
  waitHandles.Add(manualResetEvent)
  Dim taskOne = Task.Factory.StartNew(Function() New Thread(AddressOf TaskToRun).Start(manualResetEvent))
  taskOne.Wait()
  </code></pre>