Difference between calling .Wait() on an async method, and Task.Run().Wait()
<p>I have a server-side click event on a ASP.NET WebForms website. In this event I call a method which in turn calls its async partner method, adding <code>.Wait()</code> on the call.</p>

<p>This method then goes several levels down (<em>i.e.</em>, calls another async method, which calls another async method, and so on) and eventually calls an async method on an HttpClient object. At this point the thread seems to disappear down a rabbit hole; the method never calls back.</p>

<p>Now, I know that the async series of calls works as expected because the same code is also called from a Web API controller (the controller method calls the async version of that first method, not the synchronous 'partner' method), which is fully async, and it returns as expected.</p>

<p>So basically I have something like this, which never returns</p>

<pre><code>protected void btn_Click(object sender, EventArgs e)
    &gt; Class1.DoSomething()
        &gt; Class1.DoSomethingAsync.Wait()
            ...
                &gt; await ClassN.Authenticate()
                  {
                    await myHttpClient.PostAsync()  // never returns
                  }
</code></pre>

<p>I did try using <code>.ConfigureAwait(false)</code> on that first async method but without any success.</p>

<p>I also have this, which <em>does</em> return</p>

<pre><code>Task&lt;IHttpActionResult&gt; MyWebApiMethod()
    &gt; await Class1.DoSomethingAsync()
        ...
            &gt; await ClassN.Authenticate()
              {
                await myHttpClient.PostAsync()  // does return
              }
</code></pre>

<p>I've found that I can make the first version work if I change it to the following:</p>

<pre><code>protected void btn_Click(object sender, EventArgs e)
    &gt; Class1.DoSomething()
        &gt; Task.Run(async () =&gt; await Class1.DoSomethingAsync()).Wait()
            ...
                &gt; await ClassN.Authenticate()
                  {
                    await myHttpClient.PostAsync()
                  }
</code></pre>

<p>But I don't know why.</p>

<p>Can anyone explain the difference between calling </p>

<pre><code>Class1.DoSomethingAsync.Wait()
</code></pre>

<p>and calling</p>

<pre><code>Task.Run(async () =&gt; await Class1.DoSomethingAsync()).Wait()
</code></pre>