googleads / google-ads-dotnet

This project hosts the .NET client library for the Google Ads API.

Home Page:https://developers.google.com/google-ads/api

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Upgrading to v16.0.0 or later breaks all configuration

Zweitze opened this issue · comments

Describe the bug:
After upgrading an assembly to use v16.0 or higher, the library no longer works as expected. Settings in app.config, in section are no longer read.

Steps to Reproduce:

  1. Start a project and use v15.0.3 or earlier. I used v15.0.0.
  2. Write some code using it, and in App.config, section , fill in required settings like OAuth2ClientId, OAuth2ClientSecret, DeveloperToken, etc. etc,
  3. Check that the project works.
  4. Modify the project to use v16.0.0 of this library
  5. Check that the project no longer works

Expected behavior:
The project should still work. Maybe the Changelog should warn about this breaking behavior.

Client library version and API version:
16.0.0
Google Ads API version: Any
.NET version: Framework 4.7.2
Operating system (Linux, Windows, ...) and version (if the bug is platform-specific): N/A

Request/Response Logs: N/A

Anything else we should know about your project / environment

The client is generated like this:
GoogleAdsClient client = new GoogleAdsClient(new GoogleAdsConfig() { OAuth2RefreshToken = RefreshToken });
which is supposed to read the configuration from app.config. This code breaks by upgrading to v16.0.0 - settings in app.config are no longer found in member client.Config.

Note that the Changelog does mention

Moved configuration loading from App.config, settings.json and environment variables to a separate assembly.

but nothing else, not even which assembly, and the package containing that assembly. I can only assume that this is handled automatically by the dependencies. (Note that upgrading from v15.0.0 to v16.0.0 enforces updates of four or five other packages as well, it's very hard to determine which package contains the new assembly that the Changelog mentions.)

I also noticed that, when upgrading, the app.config of the project is modified and some settings are even deleted. Restoring this doesn't help.

If you have problems to reproduce I can supply an app.config - I don't think it's necessary though.

Probably introduced with #507

Hi, that is correct, #507 introduced a breaking change by moving App.config loading in a different assembly.

Please refer to this guide for configuring the client library using an App.config file from v16.0.0 onwards.