title: Googlewebauthorizationbroker.AuthorizeAsync on IIS .Net RunTime Error
body: <p>I use  <code>Googlewebauthorizationbroker.AuthorizeAsync()</code> to get token. I use "process" on website and to call ConsloeApp to get Google Calender's data. It is on visual studio(2017) work perfectly, but when I put in IIS, it is not open browser to authorize and the IIS get .Net RunTime ERROR.</p>
  
  <p>This my code. Hope can get some solution with this problem.</p>
  
  <pre><code>Public Sub  Main(args As String())
  
      Dim userID As String = "xxx"
      Dim Credential As UserCredential
  
      Dim Stream As New FileStream("~\credentials.json", FileMode.Open, FileAccess.ReadWrite)
  
      Dim credPath As String = "~\token.json"
      Credential = GoogleWebAuthorizationBroker.AuthorizeAsync(
          GoogleClientSecrets.Load(Stream).Secrets,
          Scopes,
          userID,
          CancellationToken.None,
          New FileDataStore(credPath, True)).Result
  
      Dim oService As CalendarService = New CalendarService(New BaseClientService.Initializer() With
      {
              .HttpClientInitializer = Credential,
              .ApplicationName = ApplicationName
      })
  
      Fun_List(oService)
  
      Console.ReadLine()
  End Sub
  </code></pre>
  
  <p>And this is the error message.
  <a href="https://i.stack.imgur.com/Fzd4c.jpg" rel="nofollow noreferrer">enter image description here</a></p>
  
  <p>My question might like this issue.</p>
  
  <p><a href="https://stackoverflow.com/questions/38843046/googlewebauthorizationbroker-wont-open-browser-when-running-on-iis">GoogleWebAuthorizationBroker won't open browser when running on IIS</a></p>
  
  <p><a href="https://stackoverflow.com/questions/43064047/google-auth-runs-in-visual-studio-but-hangs-when-deployed-to-iis">Google Auth runs in Visual studio but hangs when deployed to IIS</a></p>