I figured out the fix to this issue.

I added the following to the .config file:
<runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="Newtonsoft.Json" 
publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-11.0.0.0" 
newVersion="11.0.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>

And, now it works.
Just in case anyone else runs into this same issue.


On Tuesday, September 25, 2018 at 7:22:44 PM UTC-5, rogerccopa wrote:
>
> Hi,
> I am having the same issue (with the latest AdWords .NET libray v24.0.1):
>
>  "Could not load file or assembly 'Newtonsoft.Json, Version=10.0.0.0..."
> at 
> Google.Api.Ads.Common.OAuth.AdsOAuthProviderImpl.RefreshAccessTokenInOfflineMode().
>
> Just in case, I have already installed (with NuGet) Newtonsoft.Json 
> v11.0.2 and if I try to downgrade it it tries to downgrade also the Google 
> AdWords library which I don't want.
> Did anybody else have this issue? any help how to solve it?
>
> Thanks.
>
>
> On Monday, August 6, 2018 at 5:25:56 AM UTC-5, advisor managers wrote:
>>
>> hi peter
>>
>> well i try to get my refresh key but i have a problem with that .
>> i use a visual studio and i need that api for my website i cant execute 
>> the ConsoleExample.cs 
>> to get my refresh key 
>> what should i do?
>>
>> that the problem that i get :
>>
>> Google.Api.Ads.Common.Lib.AdsOAuthException
>>   HResult=0x80131500
>>   Message=Failed to refresh access token. See inner exception for details.
>>   Source=<Cannot evaluate the exception source>
>>   StackTrace:
>> <Cannot evaluate the exception stack trace>
>>
>> Inner Exception 1:
>> AggregateException: One or more errors occurred.
>>
>> Inner Exception 2:
>> TypeInitializationException: The type initializer for 
>> 'Google.Apis.Json.NewtonsoftJsonSerializer' threw an exception.
>>
>> Inner Exception 3:
>> FileLoadException: Could not load file or assembly 'Newtonsoft.Json, 
>> Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one 
>> of its dependencies. The located assembly's manifest definition does not 
>> match the assembly reference. (Exception from HRESULT: 0x80131040)
>>
>>
>>
>> thanks dian
>>
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/76cfefe2-680a-4bc0-a373-af4c73b23a4d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to