why am I getting "Method not found: Google.Api.Gax.Grpc.ClientHelper..ctor(Google.Api.Gax.Grpc.ServiceSettingsBase)'."

1,833 views
Skip to first unread message

Ward

unread,
Jun 9, 2022, 12:19:47 PM6/9/22
to Google Ads API and AdWords API Forum
/// trying out a brand new installation of the .net client library, and I'm getting this error
// on a very basic use case that is commonly presented in the Examples.

// n.b. in an effort to diagnose, the classes are fully specified
//    Once the problem is recognized, I will remove those and rely on using statements.

using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Text;
using System.Net;

using Google.Ads.GoogleAds;
using Google.Ads.GoogleAds.V10.Errors;
using Google.Ads.GoogleAds.V10.Services;
using Google.Api.Ads.Common.Util;

public class TestGoogleAdsClientAPI_2022
{
    public void run_query( string query )
    {
        try
        {
            Google.Ads.GoogleAds.Config.GoogleAdsConfig config = new
                        Google.Ads.GoogleAds.Config.GoogleAdsConfig()
            {
                DeveloperToken =     "ads_DeveloperToken",
                OAuth2Mode =         Google.Ads.Gax.Config.OAuth2Flow.APPLICATION,
                OAuth2ClientId =     "base._consumerKey_web_app",
                OAuth2ClientSecret = "base._consumerSecret_web_app_offline",
                OAuth2RefreshToken = "base.refresh_token",
            };
   
            Google.Ads.GoogleAds.Lib.GoogleAdsClient client
                        = new Google.Ads.GoogleAds.Lib.GoogleAdsClient();

            GoogleAdsServiceClient googleAdsService
                    = client.GetService( Services.V10.GoogleAdsService);      
     
            // previous line triggers an Exception, the Message ==
            // "Method not found: Google.Api.Gax.Grpc.ClientHelper..ctor(Google.Api.Gax.Grpc.ServiceSettingsBase)'."

        }
        #region TRY_CATCH
        catch( WebException e )
        {
            StringBuilder sb = new StringBuilder();
            sb.AppendLine( "Error: " );
            sb.AppendLine( $"Message: {e.Message}" );
            return sb.ToString();
        }
        catch( GoogleAdsException e )
        {
            StringBuilder sb = new StringBuilder();
            sb.AppendLine( "Error: " );
            sb.AppendLine( $"Message: {e.Message}" );
            sb.AppendLine( $"Failure: {e.Failure}" );
            sb.AppendLine( $"Request ID: {e.RequestId}" );
            return sb.ToString();
        }
        catch( Exception e )
        {
            return e.Message;
        }
        #endregion
    }
}

CFJ

unread,
Jun 9, 2022, 1:02:11 PM6/9/22
to Google Ads API and AdWords API Forum
I've been successfully running on .NET client library for well over a month.  I have 11.0.1 installed.  

Yesterday, I clicked on the available Updates in NuGet package manager and saw that 12.0.0 is now available as well as some updates to Google.Api.Gax and several other Google.Api packages.  I ran the updates and fixed a single reference where "using Google.Ads.GoogleAds.Util" had to be changed to "using Google.Ads.Gax.Util" in order for my code to compile.  Once I did this and ran my code, I immediately got the same "Method not found: Google.Api.Gax.Grpc.ClientHelper..ctor(Google.Api.Gax.Grpc.ServiceSettingsBase)'." runtime error you reported here when simply trying to grab a GoogleAdsClient.  

I didn't have time to trace through things, so I rolled back the changes until I can find time to look at it again.  However, it feels like something in the client library must still be looking for "Util" within Google.Ads.GoogleAds rather than its new home of Google.Ads.Gax. 

Google Ads API Forum Advisor

unread,
Jun 9, 2022, 3:30:16 PM6/9/22
to jmcca...@crutchfield.com, adwor...@googlegroups.com
Hi,

Thanks for getting back to us.

Since your concern is not an aligned enum for .Net client library, you may reach out to the .NET client library owner by filing an issue on the issue tracker on the Issue tab of your client library on github, so that they can provide guidance on it.  

Let us know if you have any additional questions.

Thanks,
Google Logo
Nirmita
Google Ads API Team
 


ref:_00D1U1174p._5004Q2b68yb:ref

Ward

unread,
Jun 9, 2022, 5:26:33 PM6/9/22
to Google Ads API and AdWords API Forum
Nirmita, it seems like CFJ hijacked my post with their own circumstances, but their circumstances are different than mine.  

In my situation, I have merely atttempted to use the commercially avaialable from the Latest supported client libraries, and I get the error.  In CFJ situation, they are using different libraries that are not yet released. It might be the same error message but the situation is different.

Can you please review my post and if you think your reply is what I should do, please mention it. 

Right now, it seems like the published Examples are out of date, and the published sample code fails during runtime.



Google Ads API Forum Advisor

unread,
Jun 10, 2022, 3:47:48 AM6/10/22
to wa...@nextanalytics.com, adwor...@googlegroups.com

Hi Ward,



Thanks for getting back to us.

Thank you for pointing out that your concern is different from what community user CFJ posted on your thread.

However, for us to investigate your concern further, could you please provide us with the complete request and response logs with request ID generated, so that our team can check better. For the Java client library, logging can be enabled by navigating to the Client libraries > Your client library (select .NET) > Logging documentation, which you can access from this link. You may then send the requested information via the Reply privately to author option. 

Regards,

Google Logo
Yasar
Google Ads API Team
 


ref:_00D1U1174p._5004Q2b68yb:ref

Ronny Cohen

unread,
Jun 19, 2022, 12:10:40 PM6/19/22
to Google Ads API and AdWords API Forum
HI
I'm having same issue after upgrading from V10 to V11 
Did you have any solution
Thanks
Exception: 

System.MissingMethodException
  HResult=0x80131513
  Message=Method not found: 'Void Google.Api.Gax.Grpc.ClientHelper..ctor(Google.Api.Gax.Grpc.ServiceSettingsBase)'.
  Source=Google.Ads.GoogleAds
  StackTrace:
   at Google.Ads.GoogleAds.V11.Services.GoogleAdsServiceClientImpl..ctor(GoogleAdsServiceClient grpcClient, GoogleAdsServiceSettings settings)
   at Google.Ads.GoogleAds.V11.Services.GoogleAdsServiceClient.Create(CallInvoker callInvoker, GoogleAdsServiceSettings settings)
   at Google.Ads.GoogleAds.Services.V11.Create(String serviceName, CallInvoker callInvoker, ServiceSettingsBase settings)
   at Google.Ads.Gax.Lib.AdsServiceClientFactory.Create[TService,TServiceSetting,TConfig](ServiceTemplate`3 serviceTemplate, CallInvoker callInvoker, ServiceSettingsBase serviceSettings)
   at Google.Ads.GoogleAds.Lib.GoogleAdsServiceClientFactory.GetService[TService,TServiceSetting](ServiceTemplate`3 serviceTemplate, GoogleAdsConfig config)
   at Google.Ads.GoogleAds.Lib.GoogleAdsClient.GetService[TService,TServiceSetting](ServiceTemplate`3 serviceTemplate)

Google Ads API Forum Advisor

unread,
Jun 19, 2022, 11:43:50 PM6/19/22
to ro...@storeya.com, adwor...@googlegroups.com
Hi Ronny,

I am Sherwin from Google Ads API support team. I work with Yasar and I hope that you are doing well today.

Thank you for raising this concern to the Google Ads API support team. However, for us to investigate this problem, could you please provide us with the complete request and response logs with request ID generated, so that our team can check better. For the Java client library, logging can be enabled by navigating to the Client libraries > Your client library (select .NET) > Logging documentation, which you can access from this link. You may then send the requested information via the Reply privately to author option. These logs will help us rule out if this is a Google Ads API related concern or a client library related concern. 

Warm regards,
Google Logo
Sherwin Vincent
Google Ads API Team
 


ref:_00D1U1174p._5004Q2b68yb:ref

Ronny Cohen

unread,
Jun 20, 2022, 1:10:15 AM6/20/22
to Google Ads API and AdWords API Forum
HI
Thanks for the fast replay how ever I dont have any request id this is the full exception that iget 
After u[grading to V11 Im calling the following code
 GoogleAdsClient client = new GoogleAdsClient();
 GoogleAdsServiceClient googleAdsService = client.GetService(Services.V11.GoogleAdsService);
While getting to the 2nd line the exception is throwing 
Thanks
Ronny

Google Ads API Forum Advisor

unread,
Jun 20, 2022, 3:38:44 AM6/20/22
to ro...@storeya.com, adwor...@googlegroups.com

Hi Ronny,
 

Thank you for getting back to us. I work with Sherwin &  Yasar and allow me to assist you here.
 

Upon seeing in this thread that you have not yet provided complete logs, that my colleague "Sherwin & Yasar" requested. That said, could you please provide the complete API logs (request and response logs with request ID ) so our team can identify the exact problem and provide possible recommendations to your concern?


For you to provide the complete request and response logs with request ID and request header that generated on your end, note that this can be requested or provided to the developer handling the Google Ads API transactions when logging of the API requests has been enabled. If it hasn't been enabled yet, then advise to refer to the specific guide below:


Java - https://developers.google.com/google-ads/api/docs/client-libs/java/logging

.Net - https://developers.google.com/google-ads/api/docs/client-libs/dotnet/logging

PHP - https://developers.google.com/google-ads/api/docs/client-libs/php/logging

Python - https://developers.google.com/google-ads/api/docs/client-libs/python/logging

Ruby - https://developers.google.com/google-ads/api/docs/client-libs/ruby/logging

Perl - https://developers.google.com/google-ads/api/docs/client-libs/perl/logging
 


Regards,

Google Logo
Darwin
Google Ads API Team
 

 



ref:_00D1U1174p._5004Q2b68yb:ref

Google Ads API Forum Advisor

unread,
Jun 20, 2022, 3:40:45 AM6/20/22
to ro...@storeya.com, adwor...@googlegroups.com

Hi Ronny,
 

Additional Information. Please provide it via Reply privately to the author option. If this option is not available, then send it instead on this email address googleadsa...@google.com.

Reply all
Reply to author
Forward
0 new messages