latest AdWords library v201708 has runtime error in C#

91 views
Skip to first unread message

PPC Developer

unread,
Sep 11, 2017, 4:07:53 PM9/11/17
to AdWords API Forum
Hi,

I upgraded to the latest library .v201708 and getting some runtime errors. Note that I am trying to upgrade from .v201705 which didn't have a dependency to Service
Model dll. The project wouldn't compile without adding a dependency to System.ServiceModel.dll (I added one I have on my system, which is v4.0.30319). After that, I was able to compile it. However, during runtime, I get the below exception

Could not find default endpoint element that references contract 'Google.Api.Ads.AdWords.v201708.CustomerServiceInterface' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element.


Also note that, the most recent .NET C# samples are also broken the same way. Because I also tried to create a brand new project and wanted to see how the most recent samples compile and run. They have the same issue. I guess this is never tried before by anyone? Could you please guide us into how to fix this so we can switch to the latest library?


PPC Developer

unread,
Sep 11, 2017, 4:57:05 PM9/11/17
to AdWords API Forum
Nevermind...I found out what the issue is. 

The code that was failing with runtime error was

CustomerService cs = new CustomerService;

...I had to change the above code to:

CustomerService CustSer = (CustomerService)new_Acc_user.GetService(
                            AdWordsService.v201708.CustomerService);

And it worked. Interesting that this is my 5th or 6th time upgrading the AdWords library, and first time this very old line of code got a runtime error. All good now. 
Reply all
Reply to author
Forward
0 new messages