Google API Client Library freezes in IIS when query is executed

I use the Google APIs Client Library for .NET to load Google Analytics data into my application:

Recently, although I found that it began to completely freeze. The Execute() command establishes a connection to a Google server.

He makes a successful request:

  https://accounts.google.com/o/oauth2/token 

which returns something like:

 { "access_token" : "ya30.HAKlQSGZo2GnK5wxlxx9TLTQUyD9Xkt7AZxuQnDY-KhJuCyrCtN_xHIP", "token_type" : "Bearer", "expires_in" : 3600 } 

But it never returns from an Execute call.

The same code in the console application is immediately returned, but in IIS it is not currently returned.

In the previous version, it worked just fine (I'm not quite sure which version has changed).

My Load User Profile set to true.

What could be the reason for this?

  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.gservicea ccount.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(); 
+7
asp.net-mvc oauth google-api google-analytics-api google-api-dotnet-client
source share
1 answer

As explained in the Google Calendar API - without returning from Execute () in C # , we currently have an error in the latest version of Google.Apis.Auth v 1.9. 3.

We already have a fix for this in our repository ( https://github.com/google/google-api-dotnet-client ), so you can test it yourself using the Google Analytics API ( https://developers.google. com / resources / api-libraries / download / analytics / v3 / csharp ).

A new library release is planned in the next few weeks, so stay tuned - http://google-api-dotnet-client.blogspot.com/


Update (December 15th): New NuGet packages for 1.10.0 are available, read more about this at: http://google-api-dotnet-client.blogspot.com/2015/12/announcing-release-of-1100 .html

+3
source share

All Articles