title: script task using client.GetAsync(url) not waiting for a response
body: <p>I'm running a script task in ssis to call this API, but it's not waiting for a response before it finishes.  Is there something else I need to do?</p>
  
  <pre><code>public void Main()
  {
  
      GetRequest(Dts.Variables["User::URL"].Value.ToString());
      Dts.TaskResult = (int)ScriptResults.Success;
  }
  
  private static void GetRequest(string url)
  {
     try
     {
        HttpClient client = new HttpClient();
        HttpResponseMessage response = client.GetAsync(url).Result;
        response.EnsureSuccessStatusCode();
     }
     catch (Exception e)
     {
        System.Console.WriteLine("Caught Exception: " + e.Message);
     }
  }
  </code></pre>
  
  <hr>
  
  <p>Tried this, but still not waiting:</p>
  
  <pre><code>    public async System.Threading.Tasks.Task MainAsync()
      {
  
          await GetRequestAsync(Dts.Variables["User::URL"].Value.ToString());
          Dts.TaskResult = (int)ScriptResults.Success;
      }
  
      private static async Task GetRequestAsync(string url)
      {
          try
          {
              HttpClient client = new HttpClient();
              HttpResponseMessage response = await client.GetAsync(url);
              response.EnsureSuccessStatusCode();
          }
          catch (Exception e)
          {
              System.Console.WriteLine("Caught Exception: " + e.Message);
          }
      }
  </code></pre>