title: Exception thrown: 'Grpc.Core.RpcException' in System.Private.CoreLib.dll with Google Speech API
body: <p>I am using Visual Studio 2019 on Windows 10 with Google Speech API for a .NET Console project using C# with the following code:</p>
  
  <pre><code>class Program
  {
  
      static async System.Threading.Tasks.Task&lt;object&gt; AsyncRecognizeGcsAsync()
      {
          var URI = "https://speech.googleapis.com/v1/speech:recognize?key=...";
  
          var speech = SpeechClient.Create();
          var longOperation = speech.LongRunningRecognize(new RecognitionConfig()
          {
              Encoding = RecognitionConfig.Types.AudioEncoding.Flac,
              SampleRateHertz = 44100,
              AudioChannelCount = 2,
              LanguageCode = "en",
          }, RecognitionAudio.FromStorageUri(URI));
          longOperation = longOperation.PollUntilCompleted();
          var response = longOperation.Result;
          Console.WriteLine("response.Results.Count = " + response.Results.Count);
          foreach (var result in response.Results)
          {
              foreach (var alternative in result.Alternatives)
              {
                  Console.WriteLine($"Transcript: { alternative.Transcript}");
              }
          }
  
  
          return 0;
      }
  
      static void Main(string[] args)
      {
          Console.WriteLine("Start!");
  
          AsyncRecognizeGcsAsync();
  
      }
  
  }
  </code></pre>
  
  <p>This is what I get in the Output Window:</p>
  
  <pre><code>Exception thrown: 'Grpc.Core.RpcException' in System.Private.CoreLib.dll
  The program '[22028] dotnet.exe' has exited with code 0 (0x0).
  </code></pre>
  
  <p>This is what I get in the Command Line Console:</p>
  
  <pre><code>Start!
  **********
  
  C:\Program Files\dotnet\dotnet.exe (process 25260) exited with code 0.
  To automatically close the console when debugging stops, enable Tools-&gt;Options-&gt;Debugging-&gt;Automatically close the console when debugging stops.
  Press any key to close this window . . .
  </code></pre>
  
  <p>How do I find out what the RpcException is? How do I go about fixing this?</p>
  
  <p>I tried <a href="https://stackoverflow.com/questions/45484096/grpc-proxy-server-for-google-speech-streaming-api-is-not-responding-grpc-core">this answer</a> on stack<strong>overflow</strong>, but it didn't solve the problem.</p>