title: GUI freezes when using async/await
body: <p>I'm trying to figure out what's wrong with the code below. I thought that using async and await lets me forget about GUI issues such as freezing because some long code is blocking the main thread.</p>
  
  <p>After I click the button, the GUI is responsive until the call to <code>longRunningMethod</code>, as shown below:</p>
  
  <pre><code> private async void openButton_Click(object sender, RoutedEventArgs e)
   {
      //doing some usual stuff before calling downloadFiles
      Task&lt;int&gt; result = await longRunningMethod(); // async method
  
      //at this point GUI becomes unresponsive
  
      //I'm using the result here, so I can't proceed until the longRunningMethod finishes
  
    }
  </code></pre>
  
  <p>I can't proceed until the method finishes, because I need the <code>result</code>. Why this code freezes my app?</p>