title: Waiting for Tasks to finish
body: <p>I have 2 simple methods and I want process to not continue until they are finished completely. Because of this I used await Task.WaitAll(tasks);
  but compiler is giving me error in this line: </p>
  
  <pre><code>Severity    Code    Description Project File    Line    Suppression State
  Error   CS1503  Argument 1: cannot convert from ' 
  'System.Collections.Generic.List&lt;System.Threading.Tasks.Task&gt;' to 
  'System.Threading.Tasks.Task'   
  </code></pre>
  
  <p>Why should I convert this manually by myself? I thought this would be done by the compiler...</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  using System.Threading;
  
  internal class Program
  {
      public static void Count1()
      {
          for (int i = 0; i &lt; 10; i++)
          {
              Console.WriteLine("Count 1 " + i);
              Thread.Sleep(100);
          }
      }
  
      public static void Count2()
      {
          for (int i = 0; i &lt; 20; i++)
          {
              Console.WriteLine("Count 2 " + i);
              Thread.Sleep(100);
          }
      }
  
      public static async Task Run()
      {
          List&lt;Task&gt; tasks = new List&lt;Task&gt;();
  
          Task t1 = Task.Run(()=&gt;Count1());
          Task t2 = Task.Run(() =&gt; Count2());
  
          tasks.Add(t1);
          tasks.Add(t2);
  
          await Task.WaitAll(tasks);  //ERROR IS THROWN HERE
      }
  
      private static void Main(string[] args)
      {
          Run();
  
          Console.ReadKey();
      }
  }
  </code></pre>