title: Program exits while calling await function
body: <hr>
  
  <p>Hello, I want to consume REST api. I use code like this:</p>
  
  <pre><code>namespace test2
  {
  
  class Program
  {
      static void Main(string[] args)
      {
          TestRest t = new TestRest();
          t.Run();
      }
  }
  
  public class TestRest
  {
      public TestRest() { }
  
      public async void Run()
      {
          HttpClient client = new HttpClient();
          client.BaseAddress = new Uri("https://community-league-of-legends.p.mashape.com/");
          client.DefaultRequestHeaders.Add("X-Mashape-Authorization", "tcsgoutBcXP5Lu5L2jYBOu4qeXehseiH");
          HttpResponseMessage response = await client.GetAsync("api/v1.0/euw/summoner/getSummonerByName/NICK_FROM_GAME");
  
          JObject response2 = JsonConvert.DeserializeObject(await response.Content.ReadAsStringAsync()) as JObject;
  
          foreach (KeyValuePair&lt;string, JToken&gt; j in response2)
          {
              Console.WriteLine("Key:{0} Value:{1}", j.Key, j.Value);
          }
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>But while calling method:</p>
  
  <pre><code>await client.getAsync("...
  </code></pre>
  
  <p>program is exiting. Please help me, its simple console app to consume simple api and i can not manage this :(</p>
  
  <p>Thanks</p>