Error: Method not found: 'System.AppDomainSetup System.AppDomain.get_SetupInformation()'.

534 views
Skip to first unread message

Amitha Shenoy

unread,
Dec 16, 2022, 2:46:54 AM12/16/22
to Google Ads API and AdWords API Forum
HI 

I am getting this Error
 Method not found: 'System.AppDomainSetup System.AppDomain.get_SetupInformation()'. 

when trying to create   service client
                        ConversionUploadServiceClient conversionUploadService = new GoogleAdsClient().GetService(Services.V12.ConversionUploadService);


Really appreciate any help ..


Thanks and Regards,
Amitha

Google Ads API Forum Advisor

unread,
Dec 16, 2022, 3:32:43 AM12/16/22
to amitha...@indpro.se, adwor...@googlegroups.com
Hi Amitha,

Thank you for reaching out to us.

For our team to further investigate and validate if the request is done correctly, could you please provide us with the complete API logs (request and response with request-id) 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. You may check here and click your client library for the specific guideline to enable it.

You may then send the requested logs via the Reply privately to author option. If this option is not available, you may send the details directly to our googleadsa...@google.com alias instead.

Best regards,
Google Logo
Heidi
Google Ads API Team
 


ref:_00D1U1174p._5004Q2h3jSU:ref

Amitha Shenoy

unread,
Dec 16, 2022, 6:04:05 AM12/16/22
to Google Ads API and AdWords API Forum
Used below sample code from this link https://developers.google.com/google-ads/api/docs/conversions/upload-clicks , public void Run(GoogleAdsClient client, long customerId, long conversionActionId,
    string gclid, string gbraid, string wbraid, string conversionTime,
    double conversionValue)
{
    // Get the ConversionActionService. Here i am getting the error , which was mentioned in post
    ConversionUploadServiceClient conversionUploadService =
        client.GetService(Services.V12.ConversionUploadService);

    // Creates a click conversion by specifying currency as USD.
    ClickConversion clickConversion = new ClickConversion()
    {
        ConversionAction = ResourceNames.ConversionAction(customerId, conversionActionId),
        ConversionValue = conversionValue,
        ConversionDateTime = conversionTime,
        CurrencyCode = "USD"
    };

    // Verifies that exactly one of gclid, gbraid, and wbraid is specified, as required.
    // See https://developers.google.com/google-ads/api/docs/conversions/upload-clicks
    // for details.
    string[] ids = { gclid, gbraid, wbraid };
    int idCount = ids.Where(id => !string.IsNullOrEmpty(id)).Count();

    if (idCount != 1)
    {
        throw new ArgumentException($"Exactly 1 of gclid, gbraid, or wbraid is " +
            $"required, but {idCount} ID values were provided");
    }

    // Sets the single specified ID field.
    if (!string.IsNullOrEmpty(gclid))
    {
        clickConversion.Gclid = gclid;
    }
    else if (!string.IsNullOrEmpty(wbraid))
    {
        clickConversion.Wbraid = wbraid;
    }
    else if (!string.IsNullOrEmpty(gbraid))
    {
        clickConversion.Gbraid = gbraid;
    }

    try
    {
        // Issues a request to upload the click conversion.
        UploadClickConversionsResponse response =
            conversionUploadService.UploadClickConversions(
                new UploadClickConversionsRequest()
                {
                    CustomerId = customerId.ToString(),
                    Conversions = { clickConversion },
                    PartialFailure = true,
                    ValidateOnly = false
                });

        // Prints the result.
        ClickConversionResult uploadedClickConversion = response.Results[0];
        Console.WriteLine($"Uploaded conversion that occurred at " +
            $"'{uploadedClickConversion.ConversionDateTime}' from Google " +
            $"Click ID '{uploadedClickConversion.Gclid}' to " +
            $"'{uploadedClickConversion.ConversionAction}'.");
    }
    catch (GoogleAdsException e)
    {
        Console.WriteLine("Failure:");
        Console.WriteLine($"Message: {e.Message}");
        Console.WriteLine($"Failure: {e.Failure}");
        Console.WriteLine($"Request ID: {e.RequestId}");
        throw;
    }
}

Google Ads API Forum Advisor

unread,
Dec 16, 2022, 2:39:38 PM12/16/22
to amitha...@indpro.se, adwor...@googlegroups.com
Hi Amitha,

Thank you for your reply and for the additional details you have provided.

The "Method not found: 'System.AppDomainSetup System.AppDomain.get_SetupInformation()'." error does not appear to be an API's service's error and seems to be related to the configuration of the client library you are using.

Based on your code and seeing that you appear to be using this C# example, I would recommend that you reach out to their client library owners via this link, for additional guidance on this error. I hope this helps.

Best regards,

Google Logo
Peter Laurence
Google Ads API Team
 


ref:_00D1U1174p._5004Q2h3jSU:ref

Amitha Shenoy

unread,
Dec 18, 2022, 12:46:16 AM12/18/22
to Google Ads API Forum Advisor, adwor...@googlegroups.com
Yes, i am getting error while creating   var client = new GoogleAdsClient(); instance . Thanks for assistance. I have posted my question in the link provided.
Reply all
Reply to author
Forward
0 new messages