title: Async Method Doesn't Return
body: <p>I have the following Action method that uses <code>Scanner</code> class which uses some webservice to get some data. When I use breakpoint inside <code>GetSuggestions</code> method, I can see the result. However, this data is never returned to my Action method. Instead when I check the value of <code>model</code> inside <code>Index()</code>, it is,</p>
  
  <pre><code>Id = 1, Status = System.Threading.Tasks.TaskStatus.WaitingForActivation, Method = "{null}", Result = "{Not yet computed}"
  </code></pre>
  
  <p>I checked <a href="https://stackoverflow.com/questions/10343632/httpclient-getasync-never-returns-when-using-await-async">this</a> question but It did not helped me. </p>
  
  <p><strong>Controller Action Method:</strong></p>
  
  <pre><code>[HttpGet]
  public ActionResult Index()
  {
      var plane = new Scanner();
      var model = plane.GetSuggestions("ISTANBUL");
  
      return View(model);
  }
  </code></pre>
  
  <p><strong>GetSuggestions Method :</strong></p>
  
  <pre><code>public async Task&lt;List&lt;PlaceDto&gt;&gt; GetSuggestions(string key)
  {
      string url = String.Format("URL GOES HERE", key, API_KEY);
  
      string data = await RequestProvider.Get(url);
  
      return JObject.Parse(data).SelectToken("Places").ToObject&lt;List&lt;PlaceDto&gt;&gt;();
  }
  </code></pre>
  
  <p><strong>RequestProvider Method :</strong></p>
  
  <pre><code>public static async Task&lt;string&gt; Get(string url)
  {
      using (var client = new HttpClient())
      {
          return await client.GetStringAsync(url);
      }
  }
  </code></pre>
  
  <hr>
  
  <p><strong>Edit 1</strong></p>
  
  <p>I also tried wrapping the Action method with task and waiting on <code>GetSuggestions</code> method but I receive exception on <code>client.GetStringAsync(url)</code></p>
  
  <p><strong>Exception When I use Task on Action Method</strong></p>
  
  <pre><code>System.NullReferenceException was unhandled
    HResult=-2147467261
    Message=Object reference not set to an instance of an object.
    Source=System.Web
    StackTrace:
         at System.Web.ThreadContext.AssociateWithCurrentThread(Boolean setImpersonationContext)
         at System.Web.HttpApplication.OnThreadEnterPrivate(Boolean setImpersonationContext)
         at System.Web.LegacyAspNetSynchronizationContext.CallCallbackPossiblyUnderLock(SendOrPostCallback callback, Object state)
         at System.Web.LegacyAspNetSynchronizationContext.CallCallback(SendOrPostCallback callback, Object state)
         at System.Web.LegacyAspNetSynchronizationContext.Post(SendOrPostCallback callback, Object state)
         at System.Threading.Tasks.SynchronizationContextAwaitTaskContinuation.PostAction(Object state)
         at System.Threading.Tasks.AwaitTaskContinuation.RunCallback(ContextCallback callback, Object state, Task&amp; currentTask)
      --- End of stack trace from previous location where exception was thrown ---
         at System.Threading.Tasks.AwaitTaskContinuation.&lt;ThrowAsyncIfNecessary&gt;b__1(Object s)
         at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)
         at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
         at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
         at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
         at System.Threading.ThreadPoolWorkQueue.Dispatch()
         at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
    InnerException: 
  </code></pre>
  
  <hr>
  
  <p><strong>Edit 2</strong></p>
  
  <p>I removed the await keyword from <code>await client.GetStringAsync(url);</code> and code works. However, I think this will run synchronously not async. Following is the updated Get method,</p>
  
  <pre><code>public static async Task&lt;string&gt; Get(string url)
  {
      using (var client = new HttpClient())
      {
          return client.GetStringAsync(url).Result;
      }  
  }
  </code></pre>