Google.Apis.Http.Configurable MessageHandler.d__59.MoveNext()---从上一次引发异常的位置开始的堆栈跟踪---
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()位于
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(任务任务),位于
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务任务),位于System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(任务任务),位于
Google.Apis.Auth.OAuth2.Requests.TokenRequestExtenstions.d__0.MoveNext()的System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()-从上次引发异常的位置开始的堆栈跟踪-
它在一台服务器上运行正常,但不能与另一台服务器上运行
private static async Task<string> GetAccessToken()
{
//var buildDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
string token = string.Empty;
try
{
List<string> scope = new List<string>();
scope.Add(firebaseMessagingURL); //Will Not Change --Until or unless changes by google
GoogleCredential googlCredentail = GoogleCredential.FromJson(firebasecredential).CreateScoped(scope);
token = await googlCredentail.UnderlyingCredential.GetAccessTokenForRequestAsync();
return token;
}
catch (Exception ex)
{
Logging.WriteLog(ex, Logging.LogMsgType.General, Logging.CacheStoresName.Empty.ToString());
}
return token;
}