AdWordUser object

65 views
Skip to first unread message

API_DCH

unread,
Jan 21, 2020, 5:33:59 PM1/21/20
to AdWords API and Google Ads API Forum
Hi, 

I am trying to create an azure function to retrieve data from Google Ad's account. The function fail when it try to create the AdWordsUser object, it is looking for the appconfig file.
I would like to override the function by passing a prebuilt config file or headers. I tried both ways

AdWordsUser usr = new AdWordsUser(appConfig);
AdWordsUser adwordsUser = new AdWordsUser(headers);

it errors out with following message

System.Private.CoreLib: Exception while executing function: GenerateGoogleAdsRpt. Google.Ads.Common: Could not load type 'System.Web.Hosting.HostingEnvironment' from assembly 'System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.


It is failing on the following function call, it looks for the sectionname = "AdWordsApi"

protected void LoadFromAppConfigSection(string sectionName)
        {
            ReadSettings(ReadAppConfigSection(sectionName));
        }

Have anyone found the solution already or found an alternate solution, please let me know. I appreciate your help.


Thanks
Sam

Google Ads API Forum Advisor Prod

unread,
Jan 23, 2020, 11:15:31 AM1/23/20
to dchi...@gmail.com, adwor...@googlegroups.com

Hello,

Thank you for reaching out. We only provide assistance to the concerns related to AdWords API/ Google Ads API Beta on this forum and the concern related to creating an azure function to retrieve data from Google Ads account is outside our expertise. I would recommend reaching out to the Azure support team for further assistance as they will be able to assist you better with your concerns. Feel free to reach out for any API related concerns.

Regards,
Nikisha Patel, Google Ads API Team



ref:_00D1U1174p._5001USwtfz:ref

Haik

unread,
Apr 28, 2020, 5:33:23 PM4/28/20
to AdWords API and Google Ads API Forum

 I also got this error. I am not using any Azure. I have a .net core console app

Could not load type 'System.Web.Hosting.HostingEnvironment' from assembly 'System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.":"System.Web.Hosting.HostingEnvironment"

This line causes a crash: AdWordsUser user = new AdWordsUser();


OP Did you manage to find a solution?

Google Ads API Forum Advisor Prod

unread,
Apr 29, 2020, 11:18:24 AM4/29/20
to ha...@clickcease.com, adwor...@googlegroups.com
Hi Haik,

Thank you for reaching out. This looks like an issue related to the client library so I would recommend posting your concern on the GitHub Issues page here. Their team should be more equipped to assist you.

Regards,
Mitchell

Google Ads API Team

ref:_00D1U1174p._5001UaSkdQ:ref
Reply all
Reply to author
Forward
0 new messages