googleads / googleads-dotnet-lib

Google Ad Manager SOAP API .NET client library
Apache License 2.0
108 stars 199 forks source link

SQL error when executing .exe #218

Closed pollingerMaxi closed 5 years ago

pollingerMaxi commented 5 years ago

Hello, i'm using version v201905 of the API. Developing in C# VS 2017 Enterprise, using .net framework 4.7.1

When i execute the applicacion in the IDE (debugging) the program runs with no problems, it does what it has to do, no probs. The problem comes when i execute the .exe file in the Debug/Release folder. I clean the solution, i build/rebuild the solution, generate the .exe again, and this is the error that i'm getting: Se produjo una excepción en el inicializador de tipo de "System.Data.SqlClient.SqlConnection"

I attached my App.config (i extracted sensible data) for revision. Because i think the problem is in there, based on my google searches.

But i can't seem to find anything specific anywhere.

Any help will be appreciated.

Thanks in advance!

github_config.txt

AnashOommen commented 5 years ago

This is unrelated to the google admanager api libraries, since we don’t use SqlConnection. Could you post on StackOverflow please?

pollingerMaxi commented 5 years ago

This is unrelated to the google admanager api libraries, since we don’t use SqlConnection. Could you post on StackOverflow please?

I don't think is unrelated since i have 2 applications that use the api and use the api config file. One works and the other doesn't. I already searched on SO and other sites, and the problem seems to be in the config file. Since half my config file belongs to google's api configuration, i think it can be related to the api.

AnashOommen commented 5 years ago

One way to isolate this would be to remove all AdManager API related keys from your App.config and try initializing GoogleAdManagerUser at runtime like this:

AdManagerAppConfig appConfig = new AdManagerAppConfig() {
  ....
};
AdManagerUser user = new AdManagerUser(appConfig);
pollingerMaxi commented 5 years ago

I finally was able to solve this. The problem was that i had a duplicated <add name="detailedRequestLogListener" which was causing that error.

I uncommented that section because i was told by the web support to do that to enable de logging, but it caused that problem, sigh.

Thanks anyway for the help!