I am using SpeechtoText Google API in my C# desktop application. I am trying to authenticate using json file (containing project ID and account ID etc.). When I run the code in Visual studio, it works fine but when I run a standalone installation of the same project on the same computer, the channel creation line takes forever. Probably I am missing something. Can someone please help me out?
For example, in the code snippet below, the program gets stuck in line 2.
P.S. I have tried other ways too, like creating speech client without channel and etc. Then the program stucks in SpeechClient.create().
C# Code:
var credential = GoogleCredential.FromFile(cred_filepath_var).CreateScoped(SpeechClient.DefaultScopes);
var channel = new Grpc.Core.Channel(SpeechClient.DefaultEndpoint.ToString(), credential.ToChannelCredentials());
var speech = SpeechClient.Create(channel);