Google API客户端库在发出请求时冻结在IIS中

Sim*_*ver 7 asp.net-mvc oauth google-api google-analytics-api google-api-dotnet-client

我一直在使用Google API Client Library for .NET将Google Analytics数据加载到我的应用程序中:

最近虽然我发现它已经开始完全冻结.该Execute()命令与Google服务器建立连接.

它成功地要求:

 https://accounts.google.com/o/oauth2/token
Run Code Online (Sandbox Code Playgroud)

返回类似于:

{
  "access_token" : "ya30.HAKlQSGZo2GnK5wxlxx9TLTQUyD9Xkt7AZxuQnDY-KhJuCyrCtN_xHIP",
  "token_type" : "Bearer",
  "expires_in" : 3600
} 
Run Code Online (Sandbox Code Playgroud)

但是从来没有从Execute电话中回来.

控制台应用程序中的相同代码立即返回,但在IIS中它当前永远不会返回.

在以前的版本中它工作得很好(我不确定它改变了哪个版本).

我已经Load User Profile设定为真.

可能是什么导致了这个?

   var SERVICE_ACCOUNT_PKCS12_FILE_PATH = @"C:\TEMP\GoogleAnalytics-privatekey.p12";
   X509Certificate2 certificate = new X509Certificate2(SERVICE_ACCOUNT_PKCS12_FILE_PATH, "notasecret", X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.Exportable);


   // Create credentials (not my real login here)
   ServiceAccountCredential credential = new ServiceAccountCredential(
      new ServiceAccountCredential.Initializer("86987278011-ctegcus4og7kn6oigkrv8po5pf67bbgj@developer.gserviceaccount.com")
      {
          Scopes = new[] { AnalyticsService.Scope.AnalyticsReadonly }
      }.FromCertificate(certificate));

   // Create the service
   var service = new AnalyticsService(new BaseClientService.Initializer()
   {
       HttpClientInitializer = credential,
       ApplicationName = "Google Analytics Application",

   });

   // get accounts
   accounts = service.Management.Accounts.List();
   var items = accounts.Execute();
Run Code Online (Sandbox Code Playgroud)

pel*_*yal 3

Google Calendar API - 未从 Execute() C# 返回中所述,我们目前在最新版本的 Google.Apis.Auth v 1.9.3 中存在错误。

我们已经在我们的存储库 ( https://github.com/google/google-api-dotnet-client )中对此进行了修复,因此您可以使用 Analytics API ( https://developers.google.google.com) 自行测试它。 com/resources/api-libraries/download/analytics/v3/csharp)。

该库的新版本计划在未来几周内发布,敬请关注 - http://google-api-dotnet-client.blogspot.com/


更新(12 月 15 日):1.10.0 的新 NuGet 包已可用,请访问以下网址了解更多信息:http://google-api-dotnet-client.blogspot.com/2015/12/announcing-release-of-1100。 html