title: Why File.ReadAllLinesAsync() blocks the UI thread?
body: <p>Here is my code. An event handler for WPF button that reads lines of a file:</p>
  <pre class="lang-cs prettyprint-override"><code>private async void Button_OnClick(object sender, RoutedEventArgs e)
  {
      Button.Content = &quot;Loading...&quot;;
      var lines = await File.ReadAllLinesAsync(@&quot;D:\temp.txt&quot;); //Why blocking UI Thread???
      Button.Content = &quot;Show&quot;; //Reset Button text
  }
  </code></pre>
  <p>I used asynchronous version of <code>File.ReadAllLines()</code> method in .NET Core 3.1 WPF App.</p>
  <p>But it is blocking the UI Thread! Why?</p>
  <hr />
  <p><strong>Update</strong>: Same as @Theodor Zoulias, I do a test :</p>
  <pre><code>private async void Button_OnClick(object sender, RoutedEventArgs e)
      {
          Button.Content = &quot;Loading...&quot;;
          TextBox.Text = &quot;&quot;;
  
          var stopwatch = Stopwatch.StartNew();
          var task = File.ReadAllLinesAsync(@&quot;D:\temp.txt&quot;); //Problem
          var duration1 = stopwatch.ElapsedMilliseconds;
          var isCompleted = task.IsCompleted;
          stopwatch.Restart();
          var lines = await task;
          var duration2 = stopwatch.ElapsedMilliseconds;
  
          Debug.WriteLine($&quot;Create: {duration1:#,0} msec, Task.IsCompleted: {isCompleted}&quot;);
          Debug.WriteLine($&quot;Await:  {duration2:#,0} msec, Lines: {lines.Length:#,0}&quot;);
  
  
          Button.Content = &quot;Show&quot;;
      }
  </code></pre>
  <p>result is :</p>
  <pre><code>Create: 652 msec msec, Task.IsCompleted: False | Await:   15 msec, Lines: 480,001
  </code></pre>
  <p>.NET Core 3.1, C# 8, WPF, Debug build | 7.32 Mb File(.txt) | HDD 5400 SATA</p>