Albion
Albion

Reputation: 31

Google Recaptcha Enterprise: Create Service Client issue

I've installed Google.Cloud.RecaptchaEnterprise.V1 (Version 1.6.0) and I'm using .net framework 4.7.1 I am following the instructions here https://cloud.google.com/recaptcha-enterprise/docs/create-assessment#c to authenticate the Recaptcha.

but I'm facing the bellow issues. Code is throwing an exception when it tries to run the Create command in #132 enter image description here

enter image description here

The first Error was about version 1.46 'Google.Apis.Auth, because with Google.Cloud.RecaptchaEnterprise.V1 (Version 1.6.0) installed Version 1.53 of 'Google.Apis.Auth This is the exception message:

Could not load file or assembly 'Google.Apis.Auth, Version=1.46.0.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Then I installed 'Google.Apis.Auth Version=1.46 after that I'm seeing a similar error but this time it's about version 1.53 Exception: System.IO.FileLoadException

Message: Could not load file or assembly 'Google.Apis.Auth, Version=1.53.0.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Could anyone please suggest how it can be fixed?

Upvotes: 0

Views: 1121

Answers (1)

Albion
Albion

Reputation: 31

Managed to fix this after adding Binding redirect in the web.config

<dependentAssembly>
            <assemblyIdentity name="Google.Apis.Auth" culture="neutral" publicKeyToken="4b01fa6e34db77ab" />
            <bindingRedirect oldVersion="1.46.0.0" newVersion="1.53.0.0" />
          </dependentAssembly>

Upvotes: 1

Related Questions