title: Await requires that the type 'TaskofX' have a suitable GetAwaiter Method
body: <p>I've constructed a web service ("InvStatus") which contains a single function as follows: </p>
  
  <pre><code>Imports System.Web
  Imports System.Web.Services
  Imports System.Web.Services.Protocols
  Imports System.Threading.Tasks
  
  
  &lt;WebService(Namespace:="http://example.com/InvStatus/", Name:="InvStatus",
          Description:="the description")&gt;
  &lt;WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)&gt;
  &lt;Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()&gt;
  Public Class InvStatus
  Inherits System.Web.Services.WebService
  
  Public Structure CustomReturnStruct
      Dim firstItem As String
      Dim secondItem As integer
  End Structure
  
  
  &lt;WebMethod()&gt;
    Public Async Function LookupAsync(ByVal itemCode As String) 
         As Task(Of CustomReturnStruct)
  
      Dim result As New CustomReturnStruct
  
      ' ... look up the item, and stuff the results into 
      '     result.firstItem and result.seconditem 
      ' ...
  
      return result
    End Function
  End Class
  </code></pre>
  
  <p>The services compiles fine, but when I attempt to call it from another program as a web reference:</p>
  
  <pre><code>dim myWebSvc As New com.example.InvStatus
  
  --&gt; Dim result As CustomReturnStruct = Await myWebSvc.LookupAsync("test123") &lt;--
  </code></pre>
  
  <p>...gives a compiler error saying that 'Await' requires that the type TaskOfCustomReturnStruct have a suitable GetAwaiter method</p>
  
  <p>What am I doing wrong? (and what's a GetAwaiter method??)</p>