title: Task.run not working for Database connections
body: <p>When I am using Task.run(), the console application is automatically stopping while creating a new SqlConnection(), 
    If I use normally Its working fine. <strong>I am unable to create a new connection in the console application.</strong></p>
  
  <pre><code>namespace ConsoleApplication1
   {
    class Program
    {
      static void Main(string[] args)
      {
         new Program().startTAsk();
      }
  
      public async void startTAsk()
      {
             List&lt;Task&gt; tasks = new List&lt;Task&gt;();
          for (int i = 0; i &lt; 1; i++)
          {
              tasks.Add(Task.Run(() =&gt; this.connectDB()));
          }
  
          await Task.WhenAll(tasks);
  
      }
  
      public void connectDB()
      {
          string dbDynamicConnectionString = "Data Source=192.168.1.20;Initial Catalog=Test;Persist Security Info=True;User ID=Test;Password=Test";
          bool ret = false;
          SqlConnection connection = null;
          try
          {
              using (connection = new SqlConnection(dbDynamicConnectionString))
              {
  
                  //connect to db
              }
          }
          catch (Exception ex)
          {
                console.writeLine("exception");
          }
  
  
      }
  }
  </code></pre>
  
  <p>}</p>