title: What is a replacement method for Task.Run in .NET 4.0 using C#?
body: <p>I got this program that gives me syntax error "System.Threading.Tasks.task does not contain a definition for Run."</p>
  
  <p>I am using VB 2010 .NET 4.0
  Any ideas? any replacements for Run in .net 4.0?</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Threading;
  using System.Threading.Tasks;
  
  namespace ChatApp
  {
  class ChatProg
  {
      static void Main(string[] args)
      {
          Task&lt;int&gt; wakeUp = DoWorkAsync(2000,"Waking up");
          Task.WaitAll(wakeUp);
      }
  
      static Task&lt;int&gt; DoWorkAsync(int milliseconds, string name)
      {
  
          //error appears below on word Run
          return Task.Run(() =&gt;
              {
                  Console.WriteLine("* starting {0} work", name);
                  Thread.Sleep(milliseconds);
                  Console.WriteLine("* {0} work one", name);
                  return 1;
              });
      }
  }
  }
  </code></pre>